Commit d238e02f authored by Almouhannad Hafez's avatar Almouhannad Hafez

(2) Add train accuracy

parent 3f1886ba
...@@ -680,14 +680,22 @@ ...@@ -680,14 +680,22 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Accuracy: 0.9199134199134199\n" "Train Accuracy: 0.9942112879884226\n",
"Test Accuracy: 0.9199134199134199\n"
] ]
} }
], ],
"source": [ "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", "y_pred = classifier.predict(X_test)\n",
"accuracy = accuracy_score(y_test, y_pred)\n", "test_accuracy = accuracy_score(y_test, y_pred)\n",
"print(f'Accuracy: {accuracy}')" "\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