Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.ensemble import RandomForestClassifier
- from sklearn.model_selection import cross_val_score
- forest = RandomForestClassifier(n_estimators=30, class_weight='balanced')
- x = encoded[[c for c in encoded.columns if 'snp' in c]].values
- y = classes.values
- scores = cross_val_score(forest, x, y, cv=5)
- scores.mean(), scores.std()
- # (0.53006376086711415, 0.25595331741742744)
Add Comment
Please, Sign In to add comment