Commit 5b7e5a84 authored by Udara Rangika's avatar Udara Rangika

models compared

parent 8e9a1361
......@@ -294,6 +294,79 @@
"P_svc = svc.predict(X_test)\n",
"P_knn = knn.predict(X_test)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Classification Report - Random Forest Classifier\n",
" precision recall f1-score support\n",
"\n",
" 0 1.00 1.00 1.00 96\n",
" 1 1.00 1.00 1.00 28\n",
" 2 1.00 1.00 1.00 26\n",
"\n",
" accuracy 1.00 150\n",
" macro avg 1.00 1.00 1.00 150\n",
"weighted avg 1.00 1.00 1.00 150\n",
"\n",
"\n",
"Classification Report - XGBoost Classifier\n",
" precision recall f1-score support\n",
"\n",
" 0 1.00 1.00 1.00 96\n",
" 1 1.00 1.00 1.00 28\n",
" 2 1.00 1.00 1.00 26\n",
"\n",
" accuracy 1.00 150\n",
" macro avg 1.00 1.00 1.00 150\n",
"weighted avg 1.00 1.00 1.00 150\n",
"\n",
"\n",
"Classification Report - Support Vector Machine\n",
" precision recall f1-score support\n",
"\n",
" 0 0.99 0.93 0.96 96\n",
" 1 0.73 0.79 0.76 28\n",
" 2 0.70 0.81 0.75 26\n",
"\n",
" accuracy 0.88 150\n",
" macro avg 0.81 0.84 0.82 150\n",
"weighted avg 0.89 0.88 0.88 150\n",
"\n",
"\n",
"Classification Report - KNN Classifier\n",
" precision recall f1-score support\n",
"\n",
" 0 0.96 0.95 0.95 96\n",
" 1 0.89 0.89 0.89 28\n",
" 2 0.89 0.92 0.91 26\n",
"\n",
" accuracy 0.93 150\n",
" macro avg 0.91 0.92 0.92 150\n",
"weighted avg 0.93 0.93 0.93 150\n",
"\n"
]
}
],
"source": [
"print(\"Classification Report - Random Forest Classifier\")\n",
"print(classification_report(y_test, P_rfc))\n",
"\n",
"print(\"\\nClassification Report - XGBoost Classifier\")\n",
"print(classification_report(y_test, P_xgb))\n",
"\n",
"print(\"\\nClassification Report - Support Vector Machine\")\n",
"print(classification_report(y_test, P_svc))\n",
"\n",
"print(\"\\nClassification Report - KNN Classifier\")\n",
"print(classification_report(y_test, P_knn))"
]
}
],
"metadata": {
......
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