Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. from sklearn.linear_model import LogisticRegression
  2. from sklearn.model_selection import train_test_split
  3. from sklearn.metrics import classification_report
  4.  
  5. Xtr, Xts, Ytr, Yts = train_test_split(X, Y, random_state=34)
  6.  
  7. mlp = LogisticRegression()
  8. mlp.fit(Xtr, Ytr)
  9.  
  10. print(classification_report(Yts, mlp.predict(Xts)))
  11.  
  12. '''
  13. precision recall f1-score support
  14.  
  15. fuel 0.75 0.81 0.78 26
  16. housing 0.75 0.75 0.75 32
  17. money-supply 0.84 0.88 0.86 75
  18. strategic-metal 0.86 0.90 0.88 48
  19. tea 0.90 0.82 0.86 44
  20. wheat 0.95 0.88 0.91 59
  21.  
  22. accuracy 0.85 284
  23. macro avg 0.84 0.84 0.84 284
  24. weighted avg 0.86 0.85 0.85 284
  25.  
  26. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement