Skip to content

Instantly share code, notes, and snippets.

@JustinGuese
Created October 7, 2022 11:17
Show Gist options
  • Save JustinGuese/34041d4b5198570138fcdac3d428c99e to your computer and use it in GitHub Desktop.
Save JustinGuese/34041d4b5198570138fcdac3d428c99e to your computer and use it in GitHub Desktop.
decision tree example for medium post
from sklearn import metrics, DecisionTreeClassifier
X, Y = df.drop(["signal"], axis=1), df["signal"]
clf = DecisionTreeClassifier()
clf.fit(X, Y)
preds = clf.predict(X)
print(metrics.classification_report(Y, preds))
print(metrics.confusion_matrix(Y, preds))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment