Skip to content

Commit

Permalink
first commit 2020
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-KOUAGOU committed Jan 6, 2020
1 parent 45f84bd commit 23161b2
Show file tree
Hide file tree
Showing 6 changed files with 9,321 additions and 49 deletions.
90 changes: 45 additions & 45 deletions Jean_Ndah_FML_project.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -53,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -85,7 +85,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -157,7 +157,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -249,7 +249,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -292,10 +292,10 @@
" features, target)\n",
" num_iter += 1\n",
" \n",
" def predict(self, X):\n",
" def predict(self, X_):\n",
" #We first add the intercept column\n",
" Intercept=np.ones(X.shape[0]).reshape(-1,1)\n",
" X=pd.DataFrame(np.concatenate([Intercept, X], axis=1))\n",
" Intercept=np.ones(X_.shape[0]).reshape(-1,1)\n",
" X=pd.DataFrame(np.concatenate([Intercept, X_], axis=1))\n",
" \n",
" predictions=[]\n",
" # To track the prediction progress\n",
Expand Down Expand Up @@ -468,7 +468,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f093cf19b38>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f20ec95a668>"
]
},
"execution_count": 10,
Expand Down Expand Up @@ -586,11 +586,11 @@
{
"data": {
"text/plain": [
"1400 Mild Side Effects Mild nausea if you didn't ea...\n",
"627 No Side Effects none I took the fosamax with 8...\n",
"2787 No Side Effects THERE WERE NO NOTICABLE SIDE E...\n",
"2162 Severe Side Effects Feeling like i drank 2 bot...\n",
"1870 Mild Side Effects Initially - feeling of woozi...\n",
"1004 Mild Side Effects I experienced drowsiness in ...\n",
"163 Moderate Side Effects Joint pain, reduction of...\n",
"2128 Extremely Severe Side Effects These were sever...\n",
"1047 No Side Effects None experienced Applied every...\n",
"1838 Mild Side Effects Appetite seems to fluctuate,...\n",
"Name: sideEffects, dtype: object"
]
},
Expand Down Expand Up @@ -687,27 +687,27 @@
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
Expand All @@ -729,13 +729,12 @@
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>1</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
Expand All @@ -744,18 +743,19 @@
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>...</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
Expand All @@ -779,13 +779,13 @@
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
Expand All @@ -800,10 +800,10 @@
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -812,18 +812,18 @@
],
"text/plain": [
" 0 1 2 3 4 5 6 7 8 9 ... 92 93 94 95 \\\n",
"0 1 1 0 0 0 0 0 0 0 0 ... 0 0 0 0 \n",
"0 0 1 0 0 1 0 0 0 0 0 ... 0 1 1 0 \n",
"1 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 \n",
"2 1 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 \n",
"2 0 0 0 0 0 0 0 0 1 0 ... 0 0 0 0 \n",
"3 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 \n",
"4 1 1 1 0 0 0 0 0 0 0 ... 0 0 0 1 \n",
"4 1 0 0 0 0 0 0 0 0 0 ... 0 0 0 1 \n",
"\n",
" 96 97 98 99 100 101 \n",
"0 1 0 0 0 0 1 \n",
"1 0 0 0 0 1 3 \n",
"2 0 1 1 0 0 1 \n",
"3 0 0 0 0 0 0 \n",
"4 0 0 0 1 0 0 \n",
"0 1 0 0 0 0 3 \n",
"1 0 0 0 1 1 4 \n",
"2 0 0 0 0 0 0 \n",
"3 0 0 0 0 0 4 \n",
"4 0 0 1 0 0 1 \n",
"\n",
"[5 rows x 102 columns]"
]
Expand Down Expand Up @@ -863,7 +863,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -874,7 +874,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 27,
"metadata": {},
"outputs": [
{
Expand All @@ -891,7 +891,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 28,
"metadata": {},
"outputs": [
{
Expand All @@ -908,16 +908,16 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{0, 1, 2, 4}"
"{0, 1, 2, 3, 4}"
]
},
"execution_count": 24,
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -928,14 +928,14 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 30,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Accuracy of Multiclass Logistic Regression: 44.57831325301205%\n"
"Accuracy of Multiclass Logistic Regression: 46.98795180722892%\n"
]
}
],
Expand Down
Loading

0 comments on commit 23161b2

Please sign in to comment.