Commit 75db35fc authored by Udara Rangika's avatar Udara Rangika

models created

parent 68170fbf
...@@ -72,6 +72,68 @@ ...@@ -72,6 +72,68 @@
" random_state=42\n", " random_state=42\n",
" )" " )"
] ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Models"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import seaborn as sns\n",
"from sklearn.svm import SVC\n",
"from xgboost import XGBClassifier\n",
"from matplotlib import pyplot as plt\n",
"from sklearn.neighbors import KNeighborsClassifier\n",
"from sklearn.ensemble import RandomForestClassifier\n",
"from sklearn.metrics import confusion_matrix, classification_report"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Random Forest Classifier\n",
"rfc = RandomForestClassifier(\n",
" n_estimators=100, \n",
" random_state=42\n",
" )\n",
"rfc.fit(X, Y)\n",
"print(\"Random Forest Classifier Trained\")\n",
"\n",
"# XGBoost Classifier\n",
"xgb = XGBClassifier(\n",
" n_estimators=100, \n",
" random_state=42\n",
" )\n",
"xgb.fit(X, Y)\n",
"print(\"XGBoost Classifier Trained\")\n",
"\n",
"# Support Vector Machine\n",
"svc = SVC(\n",
" kernel='linear',\n",
" random_state=42\n",
" )\n",
"svc.fit(X, Y)\n",
"print(\"Support Vector Machine Trained\")\n",
"\n",
"# KNN Classifier\n",
"knn = KNeighborsClassifier(\n",
" n_neighbors=5,\n",
" metric='minkowski',\n",
" p=2\n",
" )\n",
"knn.fit(X, Y)\n",
"print(\"KNN Classifier Trained\")"
]
} }
], ],
"metadata": { "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