Created
November 17, 2017 10:13
-
-
Save drorhilman/d690daf19d5da0e75f102648eb9245c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment