Last active
June 1, 2019 18:30
-
-
Save jetnew/667674250457641c0fe37f06252394dc to your computer and use it in GitHub Desktop.
Decision Tree using scikit-learn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.tree import DecisionTreeClassifier | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import classification_report | |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, shuffle=True) | |
clf = DecisionTreeClassifier() | |
clf.fit(X_train, y_train) | |
y_pred = clf.predict(X_test) | |
print(classification_report(y_test, y_pred)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment