Skip to content

Instantly share code, notes, and snippets.

@risenW
Created July 10, 2019 13:07
Show Gist options
  • Save risenW/409ddbcba7202e050f33c88a50b5a6e8 to your computer and use it in GitHub Desktop.
Save risenW/409ddbcba7202e050f33c88a50b5a6e8 to your computer and use it in GitHub Desktop.
#get data for classification task
X_train, X_val, y_train, y_val = get_split_data(german_cred, target_name='bad_credit')
#Train and fit these models
rand_forest_cf.fit(X_train, y_train)
extra_tree_cf.fit(X_train, y_train)
bagging_meta_cf.fit(X_train, y_train)
#check their performance
print("ACC of Random Forest is : ", get_acc(rand_forest_cf.predict(X_val), y_val))
print("ACC of Extra Trees is : ", get_acc(extra_tree_cf.predict(X_val), y_val))
print("ACC of Bagging estimator is : ", get_acc(bagging_meta_cf.predict(X_val), y_val))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment