diff --git a/Human_Activity_Recognition.ipynb b/Human_Activity_Recognition.ipynb index 607a61f..36f2c8e 100644 --- a/Human_Activity_Recognition.ipynb +++ b/Human_Activity_Recognition.ipynb @@ -43,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 9, "metadata": { "id": "dYKHNjzfCQf8" }, @@ -57,7 +57,16 @@ "warnings.filterwarnings(\"ignore\")\n", "from collections import Counter\n", "from sklearn.decomposition import PCA\n", - "from sklearn.manifold import TSNE\n" + "from sklearn.manifold import TSNE\n", + "from sklearn.model_selection import RandomizedSearchCV\n", + "from sklearn.linear_model import LogisticRegression\n", + "from sklearn.svm import SVC\n", + "from sklearn.tree import DecisionTreeClassifier\n", + "from sklearn.ensemble import RandomForestClassifier\n", + "from sklearn.metrics import confusion_matrix\n", + "from sklearn.metrics import accuracy_score\n", + "from sklearn.metrics import classification_report\n", + "\n" ] }, { @@ -71,7 +80,7 @@ "base_uri": "https://localhost:8080/" }, "id": "iiAnW8-qGWN2", - "outputId": "a8ae65c5-ae16-4222-b36d-9de8b838325a" + "outputId": "4cc33170-c006-470c-ad96-638d1d19adb1" }, "execution_count": 2, "outputs": [ @@ -116,9 +125,9 @@ "height": 367 }, "id": "vVsNZ4xDHZS5", - "outputId": "16ea8e4f-eb02-4d56-e721-1affe864f9bc" + "outputId": "31bf6dda-dae2-4635-ebc9-19cabd777b24" }, - "execution_count": 4, + "execution_count": null, "outputs": [ { "output_type": "execute_result", @@ -208,7 +217,7 @@ ], "text/html": [ "\n", - "
RandomizedSearchCV(cv=3, estimator=SVC(),\n",
+ " param_distributions={'C': [100, 50],\n",
+ " 'kernel': ['linear', 'rbf', 'poly',\n",
+ " 'sigmoid']},\n",
+ " random_state=42)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. RandomizedSearchCV(cv=3, estimator=SVC(),\n",
+ " param_distributions={'C': [100, 50],\n",
+ " 'kernel': ['linear', 'rbf', 'poly',\n",
+ " 'sigmoid']},\n",
+ " random_state=42)SVC(C=50)
SVC(C=50)
RandomizedSearchCV(estimator=DecisionTreeClassifier(),\n",
+ " param_distributions={'max_depth': array([2, 4, 6, 8])},\n",
+ " random_state=42)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. RandomizedSearchCV(estimator=DecisionTreeClassifier(),\n",
+ " param_distributions={'max_depth': array([2, 4, 6, 8])},\n",
+ " random_state=42)DecisionTreeClassifier(max_depth=np.int64(6))
DecisionTreeClassifier(max_depth=np.int64(6))
RandomizedSearchCV(estimator=RandomForestClassifier(),\n",
+ " param_distributions={'max_depth': array([ 2, 4, 6, 8, 10, 12, 14, 16]),\n",
+ " 'n_estimators': array([ 20, 30, 40, 50, 60, 70, 80, 90, 100])},\n",
+ " random_state=42)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. RandomizedSearchCV(estimator=RandomForestClassifier(),\n",
+ " param_distributions={'max_depth': array([ 2, 4, 6, 8, 10, 12, 14, 16]),\n",
+ " 'n_estimators': array([ 20, 30, 40, 50, 60, 70, 80, 90, 100])},\n",
+ " random_state=42)RandomForestClassifier(max_depth=np.int64(14), n_estimators=np.int64(100))
RandomForestClassifier(max_depth=np.int64(14), n_estimators=np.int64(100))