Skip to content

Instantly share code, notes, and snippets.

@gaphex
Last active July 7, 2019 20:10
Show Gist options
  • Save gaphex/6d3dca44ba5aa7cdca46e27266630b6b to your computer and use it in GitHub Desktop.
Save gaphex/6d3dca44ba5aa7cdca46e27266630b6b to your computer and use it in GitHub Desktop.
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
Xtr, Xts, Ytr, Yts = train_test_split(X, Y, random_state=34)
mlp = LogisticRegression()
mlp.fit(Xtr, Ytr)
print(classification_report(Yts, mlp.predict(Xts)))
'''
precision recall f1-score support
fuel 0.75 0.81 0.78 26
housing 0.75 0.75 0.75 32
money-supply 0.84 0.88 0.86 75
strategic-metal 0.86 0.90 0.88 48
tea 0.90 0.82 0.86 44
wheat 0.95 0.88 0.91 59
accuracy 0.85 284
macro avg 0.84 0.84 0.84 284
weighted avg 0.86 0.85 0.85 284
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment