Commit d238e02f authored by Almouhannad Hafez's avatar Almouhannad Hafez

(2) Add train accuracy

parent 3f1886ba
......@@ -680,14 +680,22 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Accuracy: 0.9199134199134199\n"
"Train Accuracy: 0.9942112879884226\n",
"Test Accuracy: 0.9199134199134199\n"
]
}
],
"source": [
"# training set\n",
"y_train_pred = classifier.predict(X_train)\n",
"train_accuracy = accuracy_score(y_train, y_train_pred)\n",
"\n",
"# test set\n",
"y_pred = classifier.predict(X_test)\n",
"accuracy = accuracy_score(y_test, y_pred)\n",
"print(f'Accuracy: {accuracy}')"
"test_accuracy = accuracy_score(y_test, y_pred)\n",
"\n",
"print(f'Train Accuracy: {train_accuracy}')\n",
"print(f'Test Accuracy: {test_accuracy}')"
]
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment