Created
July 17, 2019 14:16
-
-
Save focaalvarez/6740b00620cd6a4d0152533d6b67635c 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
#Train Models and get score | |
train_scores=[] | |
test_scores=[] | |
for model in model_list: | |
model.fit(X_train, y_train) | |
train_scores.append(model.score(X_train, y_train)) | |
test_scores.append(model.score(X_test, y_test)) | |
scores_df= pd.DataFrame( | |
{'Model Name': ['tree','logreg','knn','naive_b','forest','gbrt','mlp','svc'], | |
'Train Score': train_scores, | |
'Test Score': test_scores | |
}) | |
scores_df.sort_values(by=['Test Score'],ascending=False,inplace=True) | |
print(scores_df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment