Jump to content

andretkj1

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About andretkj1

  • Rank
    Newbie
  1. try ing this : https://www.w3schools.com/python/showpython.asp?filename=demo_ml_dtree4 import pandas from sklearn import tree import pydotplus from sklearn.tree import DecisionTreeClassifier import matplotlib.pyplot as plt import matplotlib.image as pltimg df = pandas.read_csv("shows.csv") d = {'UK': 0, 'USA': 1, 'N': 2} df['Nationality'] = df['Nationality'].map(d) d = {'YES': 1, 'NO': 0} df['Go'] = df['Go'].map(d) features = ['Age', 'Experience', 'Rank', 'Nationality'] X = df[features] y = df['Go'] dtree = DecisionTreeClassifier() dtree = dtree.fit(X, y) data = tree.export_graphviz
×
×
  • Create New...