text_plain_output_1.png
from sklearn import tree

from sklearn import tree

from sklearn import tree

from sklearn import tree

from sklearn import tree

from sklearn import tree

from sklearn.tree import DecisionTreeClassifier

from sklearn.tree import DecisionTreeClassifier

from sklearn.tree import DecisionTreeClassifier

from sklearn.tree import DecisionTreeClassifier

from sklearn.tree import DecisionTreeClassifier

from sklearn.tree import DecisionTreeClassifier

import graphviz

import graphviz

train.dtypes

pred = clf.predict(test)
pred

predict = clf.predict_proba(test)
predict

from sklearn import tree
from sklearn.tree import DecisionTreeClassifier
x = train.drop('TARGET', axis=1)
y = train.TARGET
clf = tree.DecisionTreeClassifier()
clf = clf.fit(x, y)

from sklearn import tree
from sklearn.tree import DecisionTreeClassifier
x = train.drop('TARGET', axis=1)
y = train.TARGET
clf = tree.DecisionTreeClassifier(max_depth=2, random_state=0, splitter='best')
clf = clf.fit(x, y)

from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
import graphviz
clf = DecisionTreeClassifier(max_depth=2, random_state=0, splitter='best')
clf.fit(x, y)
clf_feature_names = list(x.columns)
dot_data = tree.export_graphviz(clf, feature_names=clf_feature_names, class_names=['0', '1'], filled=True, rounded=True, special_characters=True, out_file=None)
graph = graphviz.Source(dot_data)
graph

from sklearn import tree
from sklearn.tree import DecisionTreeClassifier
x = train.drop('TARGET', axis=1)
y = train.TARGET
clf = tree.DecisionTreeClassifier(max_depth=3, random_state=1, splitter='best', min_samples_leaf=2)
clf = clf.fit(x, y)

from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
import graphviz
clf = tree.DecisionTreeClassifier(max_depth=3, random_state=1, splitter='best', min_samples_leaf=2)
clf.fit(x, y)
clf_feature_names = list(x.columns)
dot_data = tree.export_graphviz(clf, feature_names=clf_feature_names, class_names=['0', '1'], filled=True, rounded=True, special_characters=True, out_file=None)
graph = graphviz.Source(dot_data)
graph