Guest User

Untitled

a guest
Nov 19th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. from sklearn.ensemble import RandomForestClassifier
  2. from sklearn.model_selection import cross_val_score
  3. forest = RandomForestClassifier(n_estimators=30, class_weight='balanced')
  4.  
  5. x = encoded[[c for c in encoded.columns if 'snp' in c]].values
  6. y = classes.values
  7.  
  8. scores = cross_val_score(forest, x, y, cv=5)
  9. scores.mean(), scores.std()
  10.  
  11. # (0.53006376086711415, 0.25595331741742744)
Add Comment
Please, Sign In to add comment