Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
smote_train, smote_target = oversampler.fit_sample(train,target_train)
seed = 0 # We set our random seed to zero for reproducibility
# Random Forest parameters
rf_params = {
'n_jobs': -1,
'n_estimators': 1000,
# 'warm_start': True,
'max_features': 0.3,
'max_depth': 4,
'min_samples_leaf': 2,
'max_features' : 'sqrt',
'random_state' : seed,
'verbose': 0
rf = RandomForestClassifier(**rf_params), smote_target)
rf_predictions = rf.predict(test)
print("Accuracy score: {}".format(accuracy_score(target_val, rf_predictions)))
print(classification_report(target_val, rf_predictions))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment