Answers for "decison tree sklearn"

0

scikit decision tree classifier gini criterion

from sklearn.tree import DecisionTreeClassifier
from sklearn import metrics

# Max depth Decision tree classifier using gini criterion 

clf_gini_max = DecisionTreeClassifier(random_state=50, criterion='gini', max_depth=None)

clf_gini_max = clf_gini_max.fit(X_train,Y_train)
Y_pred = clf_gini_max.predict(X_test)

training_accuracy = clf_gini_max.score(X_train,Y_train)
testing_accuracy = clf_gini_max.score(X_test,Y_test)

print(training_accuracy)
print(testing_accuracy)
Posted by: Guest on November-08-2020
0

scikit learn decistion tree

from sklearn import tree
X = [[0, 0], [1, 1]]
Y = [0, 1]
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X, Y)
Posted by: Guest on May-03-2020
0

skit learn decision

from sklearn.datasets import load_iris
from sklearn import tree
X, y = load_iris(return_X_y=True)
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X, y)
Posted by: Guest on June-20-2020

Code answers related to "decison tree sklearn"

Browse Popular Code Answers by Language