Last active
September 3, 2020 10:20
-
-
Save AniekanInyang/1ace1cac03d1905f957794aadd7296b6 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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[LogisticRegression] Accuracy: train = 0.9714485899456998, test = 0.7962184873949579\n" | |
] | |
} | |
], | |
"source": [ | |
"from sklearn.linear_model import LogisticRegression\n", | |
"logreg = LogisticRegression(max_iter=1000, random_state=0).fit(features_train, y_train)\n", | |
"\n", | |
"print(\"[{}] Accuracy: train = {}, test = {}\".format(\n", | |
" logreg.__class__.__name__,\n", | |
" logreg.score(features_train, y_train),\n", | |
" logreg.score(features_test, y_test)))" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3.7.6 64-bit", | |
"language": "python", | |
"name": "python37664bitf2b8979454eb492e8e911544bb13ab4b" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.7.6" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment