Compare commits
27 Commits
af4291fe1e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| abbd45298a | |||
| 52a78af447 | |||
| d587a7064e | |||
| fa6d05f24a | |||
| 484a3d9b3e | |||
| cfb020fb1a | |||
| 0029a1bb70 | |||
| 1fc61d0032 | |||
| 84ad5d508c | |||
| f8af3e3f07 | |||
| 56742bab1e | |||
| 3564f7b907 | |||
| 55eca37d53 | |||
| 4bb645a352 | |||
| a9dc59fb48 | |||
| 3b772b2cfb | |||
| 74da12da7b | |||
| 5c1b77358f | |||
| c0ffaa45c9 | |||
| 62ac682385 | |||
| 8125283c7b | |||
| d17bee7ab3 | |||
| 29b5d87b57 | |||
| 37fa321655 | |||
| d3f6732211 | |||
| 53d5116bbd | |||
| f136922722 |
BIN
.\Report\CM_dt.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
.\Report\CM_rf.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
.\Report\CM_xgb.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.venv/
|
||||
516
Analysis.ipynb
@@ -6,12 +6,12 @@
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Creates a correlation matrix\n",
|
||||
"We should probably remove or combine some features"
|
||||
"This used to see if we should remove or combine some features"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": 1,
|
||||
"id": "557ed2b5",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -26,32 +26,479 @@
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"<class 'pandas.core.frame.DataFrame'>\n",
|
||||
"RangeIndex: 32561 entries, 0 to 32560\n",
|
||||
"Data columns (total 15 columns):\n",
|
||||
" # Column Non-Null Count Dtype \n",
|
||||
"--- ------ -------------- ----- \n",
|
||||
" 0 age 32561 non-null int64 \n",
|
||||
" 1 workclass 32561 non-null object\n",
|
||||
" 2 fnlwgt 32561 non-null int64 \n",
|
||||
" 3 education 32561 non-null object\n",
|
||||
" 4 education.num 32561 non-null int64 \n",
|
||||
" 5 marital.status 32561 non-null object\n",
|
||||
" 6 occupation 32561 non-null object\n",
|
||||
" 7 relationship 32561 non-null object\n",
|
||||
" 8 race 32561 non-null object\n",
|
||||
" 9 sex 32561 non-null object\n",
|
||||
" 10 capital.gain 32561 non-null int64 \n",
|
||||
" 11 capital.loss 32561 non-null int64 \n",
|
||||
" 12 hours.per.week 32561 non-null int64 \n",
|
||||
" 13 native.country 32561 non-null object\n",
|
||||
" 14 income 32561 non-null object\n",
|
||||
"dtypes: int64(6), object(9)\n",
|
||||
"memory usage: 3.7+ MB\n"
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<style scoped>\n",
|
||||
" .dataframe tbody tr th:only-of-type {\n",
|
||||
" vertical-align: middle;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe tbody tr th {\n",
|
||||
" vertical-align: top;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe thead th {\n",
|
||||
" text-align: right;\n",
|
||||
" }\n",
|
||||
"</style>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>age</th>\n",
|
||||
" <th>workclass</th>\n",
|
||||
" <th>fnlwgt</th>\n",
|
||||
" <th>education</th>\n",
|
||||
" <th>education.num</th>\n",
|
||||
" <th>marital.status</th>\n",
|
||||
" <th>occupation</th>\n",
|
||||
" <th>relationship</th>\n",
|
||||
" <th>race</th>\n",
|
||||
" <th>sex</th>\n",
|
||||
" <th>capital.gain</th>\n",
|
||||
" <th>capital.loss</th>\n",
|
||||
" <th>hours.per.week</th>\n",
|
||||
" <th>native.country</th>\n",
|
||||
" <th>income</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>90</td>\n",
|
||||
" <td>?</td>\n",
|
||||
" <td>77053</td>\n",
|
||||
" <td>HS-grad</td>\n",
|
||||
" <td>9</td>\n",
|
||||
" <td>Widowed</td>\n",
|
||||
" <td>?</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>4356</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td><=50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>82</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>132870</td>\n",
|
||||
" <td>HS-grad</td>\n",
|
||||
" <td>9</td>\n",
|
||||
" <td>Widowed</td>\n",
|
||||
" <td>Exec-managerial</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>4356</td>\n",
|
||||
" <td>18</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td><=50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>66</td>\n",
|
||||
" <td>?</td>\n",
|
||||
" <td>186061</td>\n",
|
||||
" <td>Some-college</td>\n",
|
||||
" <td>10</td>\n",
|
||||
" <td>Widowed</td>\n",
|
||||
" <td>?</td>\n",
|
||||
" <td>Unmarried</td>\n",
|
||||
" <td>Black</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>4356</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td><=50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>54</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>140359</td>\n",
|
||||
" <td>7th-8th</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>Divorced</td>\n",
|
||||
" <td>Machine-op-inspct</td>\n",
|
||||
" <td>Unmarried</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3900</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td><=50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>41</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>264663</td>\n",
|
||||
" <td>Some-college</td>\n",
|
||||
" <td>10</td>\n",
|
||||
" <td>Separated</td>\n",
|
||||
" <td>Prof-specialty</td>\n",
|
||||
" <td>Own-child</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3900</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td><=50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>5</th>\n",
|
||||
" <td>34</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>216864</td>\n",
|
||||
" <td>HS-grad</td>\n",
|
||||
" <td>9</td>\n",
|
||||
" <td>Divorced</td>\n",
|
||||
" <td>Other-service</td>\n",
|
||||
" <td>Unmarried</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3770</td>\n",
|
||||
" <td>45</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td><=50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>6</th>\n",
|
||||
" <td>38</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>150601</td>\n",
|
||||
" <td>10th</td>\n",
|
||||
" <td>6</td>\n",
|
||||
" <td>Separated</td>\n",
|
||||
" <td>Adm-clerical</td>\n",
|
||||
" <td>Unmarried</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3770</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td><=50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>7</th>\n",
|
||||
" <td>74</td>\n",
|
||||
" <td>State-gov</td>\n",
|
||||
" <td>88638</td>\n",
|
||||
" <td>Doctorate</td>\n",
|
||||
" <td>16</td>\n",
|
||||
" <td>Never-married</td>\n",
|
||||
" <td>Prof-specialty</td>\n",
|
||||
" <td>Other-relative</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3683</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>8</th>\n",
|
||||
" <td>68</td>\n",
|
||||
" <td>Federal-gov</td>\n",
|
||||
" <td>422013</td>\n",
|
||||
" <td>HS-grad</td>\n",
|
||||
" <td>9</td>\n",
|
||||
" <td>Divorced</td>\n",
|
||||
" <td>Prof-specialty</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3683</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td><=50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>9</th>\n",
|
||||
" <td>41</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>70037</td>\n",
|
||||
" <td>Some-college</td>\n",
|
||||
" <td>10</td>\n",
|
||||
" <td>Never-married</td>\n",
|
||||
" <td>Craft-repair</td>\n",
|
||||
" <td>Unmarried</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3004</td>\n",
|
||||
" <td>60</td>\n",
|
||||
" <td>?</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>10</th>\n",
|
||||
" <td>45</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>172274</td>\n",
|
||||
" <td>Doctorate</td>\n",
|
||||
" <td>16</td>\n",
|
||||
" <td>Divorced</td>\n",
|
||||
" <td>Prof-specialty</td>\n",
|
||||
" <td>Unmarried</td>\n",
|
||||
" <td>Black</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3004</td>\n",
|
||||
" <td>35</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>11</th>\n",
|
||||
" <td>38</td>\n",
|
||||
" <td>Self-emp-not-inc</td>\n",
|
||||
" <td>164526</td>\n",
|
||||
" <td>Prof-school</td>\n",
|
||||
" <td>15</td>\n",
|
||||
" <td>Never-married</td>\n",
|
||||
" <td>Prof-specialty</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>45</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>12</th>\n",
|
||||
" <td>52</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>129177</td>\n",
|
||||
" <td>Bachelors</td>\n",
|
||||
" <td>13</td>\n",
|
||||
" <td>Widowed</td>\n",
|
||||
" <td>Other-service</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Female</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>20</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>13</th>\n",
|
||||
" <td>32</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>136204</td>\n",
|
||||
" <td>Masters</td>\n",
|
||||
" <td>14</td>\n",
|
||||
" <td>Separated</td>\n",
|
||||
" <td>Exec-managerial</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>55</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>14</th>\n",
|
||||
" <td>51</td>\n",
|
||||
" <td>?</td>\n",
|
||||
" <td>172175</td>\n",
|
||||
" <td>Doctorate</td>\n",
|
||||
" <td>16</td>\n",
|
||||
" <td>Never-married</td>\n",
|
||||
" <td>?</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>15</th>\n",
|
||||
" <td>46</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>45363</td>\n",
|
||||
" <td>Prof-school</td>\n",
|
||||
" <td>15</td>\n",
|
||||
" <td>Divorced</td>\n",
|
||||
" <td>Prof-specialty</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>16</th>\n",
|
||||
" <td>45</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>172822</td>\n",
|
||||
" <td>11th</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>Divorced</td>\n",
|
||||
" <td>Transport-moving</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>76</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>17</th>\n",
|
||||
" <td>57</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>317847</td>\n",
|
||||
" <td>Masters</td>\n",
|
||||
" <td>14</td>\n",
|
||||
" <td>Divorced</td>\n",
|
||||
" <td>Exec-managerial</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>50</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>18</th>\n",
|
||||
" <td>22</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>119592</td>\n",
|
||||
" <td>Assoc-acdm</td>\n",
|
||||
" <td>12</td>\n",
|
||||
" <td>Never-married</td>\n",
|
||||
" <td>Handlers-cleaners</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>Black</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>40</td>\n",
|
||||
" <td>?</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>19</th>\n",
|
||||
" <td>34</td>\n",
|
||||
" <td>Private</td>\n",
|
||||
" <td>203034</td>\n",
|
||||
" <td>Bachelors</td>\n",
|
||||
" <td>13</td>\n",
|
||||
" <td>Separated</td>\n",
|
||||
" <td>Sales</td>\n",
|
||||
" <td>Not-in-family</td>\n",
|
||||
" <td>White</td>\n",
|
||||
" <td>Male</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2824</td>\n",
|
||||
" <td>50</td>\n",
|
||||
" <td>United-States</td>\n",
|
||||
" <td>>50K</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" age workclass fnlwgt education education.num marital.status \\\n",
|
||||
"0 90 ? 77053 HS-grad 9 Widowed \n",
|
||||
"1 82 Private 132870 HS-grad 9 Widowed \n",
|
||||
"2 66 ? 186061 Some-college 10 Widowed \n",
|
||||
"3 54 Private 140359 7th-8th 4 Divorced \n",
|
||||
"4 41 Private 264663 Some-college 10 Separated \n",
|
||||
"5 34 Private 216864 HS-grad 9 Divorced \n",
|
||||
"6 38 Private 150601 10th 6 Separated \n",
|
||||
"7 74 State-gov 88638 Doctorate 16 Never-married \n",
|
||||
"8 68 Federal-gov 422013 HS-grad 9 Divorced \n",
|
||||
"9 41 Private 70037 Some-college 10 Never-married \n",
|
||||
"10 45 Private 172274 Doctorate 16 Divorced \n",
|
||||
"11 38 Self-emp-not-inc 164526 Prof-school 15 Never-married \n",
|
||||
"12 52 Private 129177 Bachelors 13 Widowed \n",
|
||||
"13 32 Private 136204 Masters 14 Separated \n",
|
||||
"14 51 ? 172175 Doctorate 16 Never-married \n",
|
||||
"15 46 Private 45363 Prof-school 15 Divorced \n",
|
||||
"16 45 Private 172822 11th 7 Divorced \n",
|
||||
"17 57 Private 317847 Masters 14 Divorced \n",
|
||||
"18 22 Private 119592 Assoc-acdm 12 Never-married \n",
|
||||
"19 34 Private 203034 Bachelors 13 Separated \n",
|
||||
"\n",
|
||||
" occupation relationship race sex capital.gain \\\n",
|
||||
"0 ? Not-in-family White Female 0 \n",
|
||||
"1 Exec-managerial Not-in-family White Female 0 \n",
|
||||
"2 ? Unmarried Black Female 0 \n",
|
||||
"3 Machine-op-inspct Unmarried White Female 0 \n",
|
||||
"4 Prof-specialty Own-child White Female 0 \n",
|
||||
"5 Other-service Unmarried White Female 0 \n",
|
||||
"6 Adm-clerical Unmarried White Male 0 \n",
|
||||
"7 Prof-specialty Other-relative White Female 0 \n",
|
||||
"8 Prof-specialty Not-in-family White Female 0 \n",
|
||||
"9 Craft-repair Unmarried White Male 0 \n",
|
||||
"10 Prof-specialty Unmarried Black Female 0 \n",
|
||||
"11 Prof-specialty Not-in-family White Male 0 \n",
|
||||
"12 Other-service Not-in-family White Female 0 \n",
|
||||
"13 Exec-managerial Not-in-family White Male 0 \n",
|
||||
"14 ? Not-in-family White Male 0 \n",
|
||||
"15 Prof-specialty Not-in-family White Male 0 \n",
|
||||
"16 Transport-moving Not-in-family White Male 0 \n",
|
||||
"17 Exec-managerial Not-in-family White Male 0 \n",
|
||||
"18 Handlers-cleaners Not-in-family Black Male 0 \n",
|
||||
"19 Sales Not-in-family White Male 0 \n",
|
||||
"\n",
|
||||
" capital.loss hours.per.week native.country income \n",
|
||||
"0 4356 40 United-States <=50K \n",
|
||||
"1 4356 18 United-States <=50K \n",
|
||||
"2 4356 40 United-States <=50K \n",
|
||||
"3 3900 40 United-States <=50K \n",
|
||||
"4 3900 40 United-States <=50K \n",
|
||||
"5 3770 45 United-States <=50K \n",
|
||||
"6 3770 40 United-States <=50K \n",
|
||||
"7 3683 20 United-States >50K \n",
|
||||
"8 3683 40 United-States <=50K \n",
|
||||
"9 3004 60 ? >50K \n",
|
||||
"10 3004 35 United-States >50K \n",
|
||||
"11 2824 45 United-States >50K \n",
|
||||
"12 2824 20 United-States >50K \n",
|
||||
"13 2824 55 United-States >50K \n",
|
||||
"14 2824 40 United-States >50K \n",
|
||||
"15 2824 40 United-States >50K \n",
|
||||
"16 2824 76 United-States >50K \n",
|
||||
"17 2824 50 United-States >50K \n",
|
||||
"18 2824 40 ? >50K \n",
|
||||
"19 2824 50 United-States >50K "
|
||||
]
|
||||
},
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
@@ -61,27 +508,22 @@
|
||||
"from sklearn.preprocessing import LabelEncoder\n",
|
||||
"import seaborn as sns\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"df = pd.read_csv('./Datasets/adult.csv', comment = '#')\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# First, create a copy of the dataframe to avoid modifying the original\n",
|
||||
"df_encoded = df.copy()\n",
|
||||
"df_encoded.drop(['fnlwgt', 'education'], axis=1, inplace=True)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# drop all rows that contain '?'\n",
|
||||
"for column in df_encoded.columns:\n",
|
||||
" df_encoded = df_encoded[df_encoded[column] != '?']\n",
|
||||
"df_encoded = df_encoded[(df_encoded != '?').all(axis=1)]\n",
|
||||
"\n",
|
||||
"# Apply label encoding to categorical columns\n",
|
||||
"label_encoder = LabelEncoder()\n",
|
||||
"categorical_columns = ['workclass', 'marital.status', 'occupation', \n",
|
||||
" 'relationship', 'race', 'sex', 'native.country', 'income']\n",
|
||||
"\n",
|
||||
"for column in categorical_columns:\n",
|
||||
" df_encoded[column] = label_encoder.fit_transform(df_encoded[column])\n",
|
||||
"\n",
|
||||
" le = LabelEncoder()\n",
|
||||
" df_encoded[column] = le.fit_transform(df_encoded[column])\n",
|
||||
"\n",
|
||||
"matrix = df_encoded.corr()\n",
|
||||
"\n",
|
||||
@@ -91,8 +533,8 @@
|
||||
"plt.show()\n",
|
||||
"\n",
|
||||
"#df_encoded.head(10)\n",
|
||||
"df.info()\n",
|
||||
"\n"
|
||||
"#df_encoded.info()\n",
|
||||
"df.head(20)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
BIN
Report/CM_dt.png
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
Report/CM_rf.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
Report/CM_xgb.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
@@ -15,24 +15,62 @@
|
||||
\gdef\HyperFirstAtBeginDocument#1{#1}
|
||||
\providecommand\HyField@AuxAddToFields[1]{}
|
||||
\providecommand\HyField@AuxAddToCoFields[2]{}
|
||||
\bibstyle{model1-num-names}
|
||||
\bibcite{Steinhaus:Mathematical}{1}
|
||||
\bibcite{Greivenkamp:FieldGuide}{2}
|
||||
\bibcite{Pedrotti:Introduction}{3}
|
||||
\bibcite{Davis:ChemWiki}{4}
|
||||
\babel@aux{english}{}
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}{section.1}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {2}Data analysis}{1}{section.2}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Dataset}{1}{subsection.2.1}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Data cleaning and feature engineering}{1}{subsection.2.2}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Handling missing values}{1}{subsection.2.3}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Model selection}{1}{section.3}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Model Training and Hyperparameter Tuning}{1}{section.4}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {5}Model Evaluations}{1}{section.5}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {6}}{1}{section.6}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{References}{1}{section.6}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Handling missing values}{2}{subsection.2.3}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Training, validation and test sets}{2}{subsection.2.4}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {3}Model selection}{2}{section.3}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Model Training and Hyperparameter Tuning}{2}{section.4}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Models and methods used}{2}{subsection.4.1}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Validation Results}{2}{subsection.4.2}\protected@file@percent }
|
||||
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces The weighted averages of the performance metrics of the models on the validation data.\relax }}{2}{table.caption.1}\protected@file@percent }
|
||||
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
|
||||
\newlabel{perfmetric}{{1}{2}{The weighted averages of the performance metrics of the models on the validation data.\relax }{table.caption.1}{}}
|
||||
\newlabel{perfmetric@cref}{{[table][1][]1}{[1][2][]2}}
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Caveats and restrictions}{2}{subsection.4.3}\protected@file@percent }
|
||||
\newlabel{fig:featureImportanceDT}{{1(a)}{3}{\relax }{figure.caption.2}{}}
|
||||
\newlabel{fig:featureImportanceDT@cref}{{[subfigure][1][1]1(a)}{[1][3][]3}}
|
||||
\newlabel{sub@fig:featureImportanceDT}{{(a)}{3}{\relax }{figure.caption.2}{}}
|
||||
\newlabel{sub@fig:featureImportanceDT@cref}{{[subfigure][1][1]1(a)}{[1][3][]3}}
|
||||
\newlabel{fig:featureImportanceRF}{{1(b)}{3}{\relax }{figure.caption.2}{}}
|
||||
\newlabel{fig:featureImportanceRF@cref}{{[subfigure][2][1]1(b)}{[1][3][]3}}
|
||||
\newlabel{sub@fig:featureImportanceRF}{{(b)}{3}{\relax }{figure.caption.2}{}}
|
||||
\newlabel{sub@fig:featureImportanceRF@cref}{{[subfigure][2][1]1(b)}{[1][3][]3}}
|
||||
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces The confusion matricies of the Decision Tree model and the Random Forest model on the test data.\relax }}{3}{figure.caption.2}\protected@file@percent }
|
||||
\newlabel{fig:}{{1}{3}{The confusion matricies of the Decision Tree model and the Random Forest model on the test data.\relax }{figure.caption.2}{}}
|
||||
\newlabel{fig:@cref}{{[figure][1][]1}{[1][3][]3}}
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {5}Model Evaluations}{3}{section.5}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Analyzing the Confusion Matricies}{3}{subsection.5.1}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.2}Analyzing Weighted Performance Metrics}{3}{subsection.5.2}\protected@file@percent }
|
||||
\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces The weighted averages of the performance metrics of the models on the test data.\relax }}{3}{table.caption.3}\protected@file@percent }
|
||||
\newlabel{perfmetrictest}{{2}{3}{The weighted averages of the performance metrics of the models on the test data.\relax }{table.caption.3}{}}
|
||||
\newlabel{perfmetrictest@cref}{{[table][2][]2}{[1][3][]3}}
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3}Analyzing the Performance}{4}{subsection.5.3}\protected@file@percent }
|
||||
\@writefile{lot}{\contentsline {table}{\numberline {3}{\ignorespaces Class-wise performance metrics of the Decision Tree.\relax }}{4}{table.caption.4}\protected@file@percent }
|
||||
\newlabel{dt_metrics}{{3}{4}{Class-wise performance metrics of the Decision Tree.\relax }{table.caption.4}{}}
|
||||
\newlabel{dt_metrics@cref}{{[table][3][]3}{[1][4][]4}}
|
||||
\@writefile{lot}{\contentsline {table}{\numberline {4}{\ignorespaces Class-wise performance metrics of the Random Forest.\relax }}{4}{table.caption.5}\protected@file@percent }
|
||||
\newlabel{rf_metrics}{{4}{4}{Class-wise performance metrics of the Random Forest.\relax }{table.caption.5}{}}
|
||||
\newlabel{rf_metrics@cref}{{[table][4][]4}{[1][4][]4}}
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4}Overfitting and Underfitting}{4}{subsection.5.4}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5}Feature Importance}{4}{subsection.5.5}\protected@file@percent }
|
||||
\newlabel{fig:featureImportanceDT}{{2(a)}{5}{\relax }{figure.caption.6}{}}
|
||||
\newlabel{fig:featureImportanceDT@cref}{{[subfigure][1][2]2(a)}{[1][4][]5}}
|
||||
\newlabel{sub@fig:featureImportanceDT}{{(a)}{5}{\relax }{figure.caption.6}{}}
|
||||
\newlabel{sub@fig:featureImportanceDT@cref}{{[subfigure][1][2]2(a)}{[1][4][]5}}
|
||||
\newlabel{fig:featureImportanceRF}{{2(b)}{5}{\relax }{figure.caption.6}{}}
|
||||
\newlabel{fig:featureImportanceRF@cref}{{[subfigure][2][2]2(b)}{[1][4][]5}}
|
||||
\newlabel{sub@fig:featureImportanceRF}{{(b)}{5}{\relax }{figure.caption.6}{}}
|
||||
\newlabel{sub@fig:featureImportanceRF@cref}{{[subfigure][2][2]2(b)}{[1][4][]5}}
|
||||
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces The feature importance graphs for the Decision Tree model and the Random Forest model based on the validation data.\relax }}{5}{figure.caption.6}\protected@file@percent }
|
||||
\newlabel{fig:}{{2}{5}{The feature importance graphs for the Decision Tree model and the Random Forest model based on the validation data.\relax }{figure.caption.6}{}}
|
||||
\newlabel{fig:@cref}{{[figure][2][]2}{[1][4][]5}}
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {6}Summary}{5}{section.6}\protected@file@percent }
|
||||
\ttl@finishall
|
||||
\newlabel{LastPage}{{}{2}{}{page.2}{}}
|
||||
\xdef\lastpage@lastpage{2}
|
||||
\xdef\lastpage@lastpageHy{2}
|
||||
\gdef \@abspage@last{2}
|
||||
\newlabel{LastPage}{{}{5}{}{page.5}{}}
|
||||
\xdef\lastpage@lastpage{5}
|
||||
\xdef\lastpage@lastpageHy{5}
|
||||
\gdef \@abspage@last{5}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Fdb version 4
|
||||
["pdflatex"] 1761129238.9062 "/home/jaknyst/Documents/MLPproject/Report/MLPproject.tex" "MLPproject.pdf" "MLPproject" 1761129240.39559 0
|
||||
"/home/jaknyst/Documents/MLPproject/Report/MLPproject.tex" 1761129236.61965 6049 c7e7910f66e6a5624dd2e411a4d86264 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc" 1721433600 4850 80dc9bab7f31fb78a000ccfed0e27cab ""
|
||||
["pdflatex"] 1761921952.93435 "/home/petrus/Documents/MLP/Projects/MLPproject/Report/MLPproject.tex" "MLPproject.pdf" "MLPproject" 1761921953.99247 0
|
||||
"/home/petrus/Documents/MLP/Projects/MLPproject/Report/MLPproject.tex" 1761921952.70534 24812 36992a9467feb6ff9f9f97a89afe5aee ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc" 1737590400 4850 80dc9bab7f31fb78a000ccfed0e27cab ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb7t.tfm" 1136768653 2240 eb56c13537f4d8a0bd3fafc25572b1bd ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm" 1136768653 4484 b828043cbd581d289d955903c1339981 ""
|
||||
@@ -10,7 +10,6 @@
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvro7t.tfm" 1136768653 2772 ab6561c8ff5ee69ff6d5961b9356db5a ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvro8r.tfm" 1136768653 4964 f223217e5e1f85fa3742fb0480aba9e8 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmb7t.tfm" 1136768653 2172 fd0c924230362ff848a33632ed45dc23 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmb8r.tfm" 1136768653 4524 6bce29db5bc272ba5f332261583fee9c ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr7t.tfm" 1136768653 2124 2601a75482e9426d33db523edf23570a ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8c.tfm" 1136768653 1352 fa28a7e6d323c65ce7d13d5342ff6be2 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8r.tfm" 1136768653 4408 25b74d011a4c66b7f212c0cc3c90061b ""
|
||||
@@ -24,15 +23,13 @@
|
||||
"/usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvb8a.pfb" 1136849748 35941 f27169cc74234d5bd5e4cca5abafaabb ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb" 1136849748 44648 23115b2a545ebfe2c526c3ca99db8b95 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvro8a.pfb" 1136849748 48169 b4fd9d908b9ee8c65d4305ad39071c5e ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb" 1136849748 44729 811d6c62865936705a31c797a1d5dada ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb" 1136849748 46026 6dab18b61c907687b520c72847215a68 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvb7t.vf" 1136768653 1372 1c26b449eb4a1a0bcf6ac7cfe376d450 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvr7t.vf" 1136768653 1372 dc841a9f00a1a11b1443367ae6c5588e ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvro7t.vf" 1136768653 1372 9948cedecdb0445a3b5cf1b8a8082ab8 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmb7t.vf" 1136768653 1372 788387fea833ef5963f4c5bffe33eb89 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr7t.vf" 1136768653 1380 0ea3a3370054be6da6acd929ec569f06 ""
|
||||
"/usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr8c.vf" 1136768653 3556 8a9a6dcbcd146ef985683f677f4758a6 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii" 1721433600 71627 94eb9990bed73c364d7f53f960cc8c5b ""
|
||||
"/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii" 1737590400 71627 94eb9990bed73c364d7f53f960cc8c5b ""
|
||||
"/usr/share/texlive/texmf-dist/tex/generic/atbegshi/atbegshi.sty" 1575674566 24708 5584a51a7101caf7e6bbf1fc27d8f7b1 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/generic/babel-english/english.ldf" 1496785618 7008 9ff5fdcc865b01beca2b0fe4a46231d4 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty" 1676321701 151363 1f5971af3ef874d432e8fb43e0edb71d ""
|
||||
@@ -62,13 +59,13 @@
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty" 1654720880 2444 70065bddd85997dc1fd0bb7ae634e5fa ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/atveryend/atveryend.sty" 1576191570 19336 ce7ae9438967282886b3b036cfad1e4d ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty" 1576625391 3935 57aa3c3e203a5c2effb4d2bd2efbc323 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/article.cls" 1721433600 20144 d5ecf0a5140c8d8d8b72cbe86e320eff ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/atbegshi-ltx.sty" 1721433600 3052 30236f0cc243a8651b82240dfd2e8b9d ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/atveryend-ltx.sty" 1721433600 2462 8ce5f9a9c63002f2c1af03c262cf29af ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/fleqn.clo" 1721433600 4807 d162528c27809003cc96755db6ca2bef ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty" 1721433600 5319 48d7f3cfa322abd2788e3c09d624b922 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty" 1721433600 5048 84b05796b49b69e2d4257d537721c960 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo" 1721433600 8448 c33a4e1cb35cee9b33c2b21033b73e39 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/article.cls" 1737590400 20144 d5ecf0a5140c8d8d8b72cbe86e320eff ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/atbegshi-ltx.sty" 1737590400 3052 30236f0cc243a8651b82240dfd2e8b9d ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/atveryend-ltx.sty" 1737590400 2462 8ce5f9a9c63002f2c1af03c262cf29af ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/fleqn.clo" 1737590400 4807 d162528c27809003cc96755db6ca2bef ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty" 1737590400 5319 48d7f3cfa322abd2788e3c09d624b922 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty" 1737590400 5048 84b05796b49b69e2d4257d537721c960 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo" 1737590400 8448 c33a4e1cb35cee9b33c2b21033b73e39 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/booktabs/booktabs.sty" 1579038678 6078 f1cb470c9199e7110a27851508ed7a5c ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty" 1678653221 55778 14d5c99aa26410e440820bb9ea5b8b3a ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty" 1678653221 71836 1a735454ad10692452eb2f2fc37f3865 ""
|
||||
@@ -129,14 +126,18 @@
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty" 1654720880 10214 de3e21cfc0eccc98ca7f8dac0ef263d2 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/url/url.sty" 1388531844 12796 8edb7d69a20b857904dd0ea757c14ec9 ""
|
||||
"/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty" 1655066402 56148 51a9a8571c07b9921892ae11063ae853 ""
|
||||
"/usr/share/texlive/texmf-dist/web2c/texmf.cnf" 1721433600 40900 887e0dc8cac988a9e9c574af364cf837 ""
|
||||
"/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1760290233.68077 4602002 62dba5fc29055c16380d7393a2adb07a ""
|
||||
"/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1760289849 7753794 892d611f76aecccd13eb485815d0543e ""
|
||||
"MLPproject.aux" 1761129240.22236 2066 62a9c5cb48c4e643fe8b2fb1bba9b77b "pdflatex"
|
||||
"MLPproject.out" 1761129240.22436 1374 b4a2caeadb43696bbe5350199c3331b3 "pdflatex"
|
||||
"MLPproject.tex" 1761129236.61965 6049 c7e7910f66e6a5624dd2e411a4d86264 ""
|
||||
"MLPproject.toc" 1761129240.22436 796 63fff7a313a297867c97aa2dfbafdb7f "pdflatex"
|
||||
"SelfArx.cls" 1761123180.54708 7316 506603b27aab6da8087bc0f1ee693041 ""
|
||||
"/usr/share/texlive/texmf-dist/web2c/texmf.cnf" 1737590400 40900 887e0dc8cac988a9e9c574af364cf837 ""
|
||||
"/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1761127463.65456 4602601 5d02a5c5d52d7237566d144856366042 ""
|
||||
"/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1761127067 7753793 c9f4d2c19ab997188c605d7179b0cdc0 ""
|
||||
"CM_dt.png" 1761920482.34887 97023 ce9f07bdb4551ffd7f80782b99a54328 ""
|
||||
"CM_rf.png" 1761920484.96582 98726 a24b8d53317f0e7e65e41ed83ef8fae5 ""
|
||||
"MLPproject.aux" 1761921953.8967 6698 d2e044226fe88697053e22eec695a818 "pdflatex"
|
||||
"MLPproject.out" 1761921953.8997 3113 d57c5f2b0e6699323b0a2645b9706cce "pdflatex"
|
||||
"MLPproject.tex" 1761921952.70534 24812 36992a9467feb6ff9f9f97a89afe5aee ""
|
||||
"MLPproject.toc" 1761921953.8997 1587 6a7d8c5cbfca28921bcd78f124e2ec7a "pdflatex"
|
||||
"SelfArx.cls" 1761125830.98333 7316 506603b27aab6da8087bc0f1ee693041 ""
|
||||
"featureImportanceDT.png" 1761403205.10917 60078 4a2e56e2a45ae2ae5e41b9830c1bbcea ""
|
||||
"featureImportanceRF.png" 1761403205.11075 61794 6b3eefc625dd3da8a3dbf302174c614c ""
|
||||
(generated)
|
||||
"MLPproject.aux"
|
||||
"MLPproject.log"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
PWD /home/jaknyst/Documents/MLPproject/Report
|
||||
PWD /home/petrus/Documents/MLP/Projects/MLPproject/Report
|
||||
INPUT /usr/share/texlive/texmf-dist/web2c/texmf.cnf
|
||||
INPUT /usr/share/texlive/texmf-dist/web2c/texmf.cnf
|
||||
INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt
|
||||
INPUT /home/jaknyst/Documents/MLPproject/Report/MLPproject.tex
|
||||
INPUT /home/petrus/Documents/MLP/Projects/MLPproject/Report/MLPproject.tex
|
||||
OUTPUT MLPproject.log
|
||||
INPUT ./SelfArx.cls
|
||||
INPUT ./SelfArx.cls
|
||||
@@ -996,8 +996,6 @@ INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd
|
||||
INPUT /usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8c.tfm
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr7t.tfm
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr7t.tfm
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvb7t.vf
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm
|
||||
INPUT /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map
|
||||
@@ -1025,13 +1023,30 @@ INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvb8r.tfm
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr7t.vf
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmr8r.tfm
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmr8c.vf
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/vf/adobe/times/ptmb7t.vf
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/adobe/times/ptmb8r.tfm
|
||||
INPUT ./CM_dt.png
|
||||
INPUT ./CM_dt.png
|
||||
INPUT CM_dt.png
|
||||
INPUT ./CM_dt.png
|
||||
INPUT ./CM_dt.png
|
||||
INPUT ./CM_rf.png
|
||||
INPUT ./CM_rf.png
|
||||
INPUT CM_rf.png
|
||||
INPUT ./CM_rf.png
|
||||
INPUT ./CM_rf.png
|
||||
INPUT ./featureImportanceDT.png
|
||||
INPUT ./featureImportanceDT.png
|
||||
INPUT featureImportanceDT.png
|
||||
INPUT ./featureImportanceDT.png
|
||||
INPUT ./featureImportanceDT.png
|
||||
INPUT ./featureImportanceRF.png
|
||||
INPUT ./featureImportanceRF.png
|
||||
INPUT featureImportanceRF.png
|
||||
INPUT ./featureImportanceRF.png
|
||||
INPUT ./featureImportanceRF.png
|
||||
INPUT MLPproject.aux
|
||||
INPUT ./MLPproject.out
|
||||
INPUT ./MLPproject.out
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvb8a.pfb
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvro8a.pfb
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb
|
||||
INPUT /usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2025.10.12) 22 OCT 2025 12:33
|
||||
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2025.10.22) 31 OCT 2025 15:45
|
||||
entering extended mode
|
||||
restricted \write18 enabled.
|
||||
file:line:error style messages enabled.
|
||||
%&-line parsing enabled.
|
||||
**/home/jaknyst/Documents/MLPproject/Report/MLPproject.tex
|
||||
(/home/jaknyst/Documents/MLPproject/Report/MLPproject.tex
|
||||
**/home/petrus/Documents/MLP/Projects/MLPproject/Report/MLPproject.tex
|
||||
(/home/petrus/Documents/MLP/Projects/MLPproject/Report/MLPproject.tex
|
||||
LaTeX2e <2022-11-01> patch level 1
|
||||
L3 programming layer <2023-02-22> (./SelfArx.cls
|
||||
Document Class: SelfArx 25/01/2012, v1.0
|
||||
@@ -494,7 +494,38 @@ LaTeX Info: Redefining \labelcpageref on input line 2370.
|
||||
LaTeX Font Info: Trying to load font information for OT1+ptm on input line 54.
|
||||
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1ptm.fd
|
||||
File: ot1ptm.fd 2001/06/04 font definitions for OT1/ptm.
|
||||
) (./MLPproject.aux)
|
||||
) (./MLPproject.aux
|
||||
|
||||
LaTeX Warning: Label `fig:featureImportanceDT' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `fig:featureImportanceDT@cref' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `sub@fig:featureImportanceDT' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `sub@fig:featureImportanceDT@cref' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `fig:featureImportanceRF' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `fig:featureImportanceRF@cref' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `sub@fig:featureImportanceRF' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `sub@fig:featureImportanceRF@cref' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `fig:' multiply defined.
|
||||
|
||||
|
||||
LaTeX Warning: Label `fig:@cref' multiply defined.
|
||||
|
||||
)
|
||||
\openout1 = `MLPproject.aux'.
|
||||
|
||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 54.
|
||||
@@ -651,63 +682,56 @@ LaTeX Font Info: Font shape `OT1/phv/m/it' in size <8> not available
|
||||
\tf@toc=\write4
|
||||
\openout4 = `MLPproject.toc'.
|
||||
|
||||
LaTeX Font Info: Trying to load font information for TS1+ptm on input line 75.
|
||||
LaTeX Font Info: Trying to load font information for TS1+ptm on input line 77.
|
||||
(/usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd
|
||||
File: ts1ptm.fd 2001/06/04 font definitions for TS1/ptm.
|
||||
)
|
||||
Underfull \hbox (badness 1448) in paragraph at lines 116--120
|
||||
[]\OT1/ptm/m/n/10 (+20) UC Davis ChemWiki, Prop-a-ga-tion of Er-ror, Avail-
|
||||
[]
|
||||
) [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}{/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc}
|
||||
|
||||
|
||||
Underfull \hbox (badness 7649) in paragraph at lines 116--120
|
||||
\OT1/ptm/m/n/10 (+20) able at: [][]$https : / / chem . libretexts . org / Textbook[]Maps /
|
||||
[]
|
||||
|
||||
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 116--120
|
||||
\OT1/ptm/m/n/10 (+20) Analytical[]Chemistry / Supplemental[]Modules[]
|
||||
[]
|
||||
|
||||
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 116--120
|
||||
\OT1/ptm/m/n/10 (+20) (Analytical[]Chemistry ) /Quantifying[]Nature /
|
||||
[]
|
||||
|
||||
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 116--120
|
||||
\OT1/ptm/m/n/10 (+20) Signi^^Lcant[]Digits / Propagation[]of[]Error$[][], (Ac-cessed:
|
||||
[]
|
||||
|
||||
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}{/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc}
|
||||
|
||||
|
||||
]
|
||||
|
||||
Package caption Warning: Unused \captionsetup[subfigure] on input line 32.
|
||||
See the caption package documentation for explanation.
|
||||
|
||||
[2
|
||||
|
||||
]
|
||||
] [2]
|
||||
<CM_dt.png, id=129, 462.528pt x 346.896pt>
|
||||
File: CM_dt.png Graphic file (type png)
|
||||
<use CM_dt.png>
|
||||
Package pdftex.def Info: CM_dt.png used on input line 123.
|
||||
(pdftex.def) Requested size: 230.29584pt x 172.7224pt.
|
||||
<CM_rf.png, id=131, 462.528pt x 346.896pt>
|
||||
File: CM_rf.png Graphic file (type png)
|
||||
<use CM_rf.png>
|
||||
Package pdftex.def Info: CM_rf.png used on input line 130.
|
||||
(pdftex.def) Requested size: 230.29584pt x 172.7224pt.
|
||||
[3 <./CM_dt.png> <./CM_rf.png>]
|
||||
<featureImportanceDT.png, id=147, 416.2752pt x 393.8715pt>
|
||||
File: featureImportanceDT.png Graphic file (type png)
|
||||
<use featureImportanceDT.png>
|
||||
Package pdftex.def Info: featureImportanceDT.png used on input line 209.
|
||||
(pdftex.def) Requested size: 206.0563pt x 194.96999pt.
|
||||
<featureImportanceRF.png, id=148, 422.0568pt x 393.8715pt>
|
||||
File: featureImportanceRF.png Graphic file (type png)
|
||||
<use featureImportanceRF.png>
|
||||
Package pdftex.def Info: featureImportanceRF.png used on input line 216.
|
||||
(pdftex.def) Requested size: 206.0563pt x 192.29555pt.
|
||||
[4] [5 <./featureImportanceDT.png> <./featureImportanceRF.png>]
|
||||
enddocument/afterlastpage: lastpage setting LastPage.
|
||||
(./MLPproject.aux)
|
||||
|
||||
LaTeX Warning: There were multiply-defined labels.
|
||||
|
||||
Package rerunfilecheck Info: File `MLPproject.out' has not changed.
|
||||
(rerunfilecheck) Checksum: B4A2CAEADB43696BBE5350199C3331B3;1374.
|
||||
(rerunfilecheck) Checksum: D57C5F2B0E6699323B0A2645B9706CCE;3113.
|
||||
)
|
||||
Here is how much of TeX's memory you used:
|
||||
18917 strings out of 476041
|
||||
320357 string characters out of 5793173
|
||||
19066 strings out of 476041
|
||||
322326 string characters out of 5793173
|
||||
1878388 words of memory out of 6000000
|
||||
38854 multiletter control sequences out of 15000+600000
|
||||
568376 words of font info for 247 fonts, out of 8000000 for 9000
|
||||
38909 multiletter control sequences out of 15000+600000
|
||||
569401 words of font info for 297 fonts, out of 8000000 for 9000
|
||||
1137 hyphenation exceptions out of 8191
|
||||
75i,12n,77p,1049b,626s stack positions out of 10000i,1000n,20000p,200000b,200000s
|
||||
</usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvb8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvro8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb>
|
||||
Output written on MLPproject.pdf (2 pages, 59091 bytes).
|
||||
75i,12n,77p,1812b,605s stack positions out of 10000i,1000n,20000p,200000b,200000s
|
||||
</usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvb8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvro8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb>
|
||||
Output written on MLPproject.pdf (5 pages, 305913 bytes).
|
||||
PDF statistics:
|
||||
115 PDF objects out of 1000 (max. 8388607)
|
||||
90 compressed objects within 1 object stream
|
||||
16 named destinations out of 1000 (max. 500000)
|
||||
98385 words of extra memory for PDF output out of 106986 (max. 10000000)
|
||||
191 PDF objects out of 1000 (max. 8388607)
|
||||
148 compressed objects within 2 object streams
|
||||
30 named destinations out of 1000 (max. 500000)
|
||||
92325 words of extra memory for PDF output out of 106986 (max. 10000000)
|
||||
|
||||
|
||||
@@ -3,8 +3,16 @@
|
||||
\BOOKMARK [2][-]{subsection.2.1}{\376\377\000D\000a\000t\000a\000s\000e\000t}{section.2}% 3
|
||||
\BOOKMARK [2][-]{subsection.2.2}{\376\377\000D\000a\000t\000a\000\040\000c\000l\000e\000a\000n\000i\000n\000g\000\040\000a\000n\000d\000\040\000f\000e\000a\000t\000u\000r\000e\000\040\000e\000n\000g\000i\000n\000e\000e\000r\000i\000n\000g}{section.2}% 4
|
||||
\BOOKMARK [2][-]{subsection.2.3}{\376\377\000H\000a\000n\000d\000l\000i\000n\000g\000\040\000m\000i\000s\000s\000i\000n\000g\000\040\000v\000a\000l\000u\000e\000s}{section.2}% 5
|
||||
\BOOKMARK [1][-]{section.3}{\376\377\000M\000o\000d\000e\000l\000\040\000s\000e\000l\000e\000c\000t\000i\000o\000n}{}% 6
|
||||
\BOOKMARK [1][-]{section.4}{\376\377\000M\000o\000d\000e\000l\000\040\000T\000r\000a\000i\000n\000i\000n\000g\000\040\000a\000n\000d\000\040\000H\000y\000p\000e\000r\000p\000a\000r\000a\000m\000e\000t\000e\000r\000\040\000T\000u\000n\000i\000n\000g}{}% 7
|
||||
\BOOKMARK [1][-]{section.5}{\376\377\000M\000o\000d\000e\000l\000\040\000E\000v\000a\000l\000u\000a\000t\000i\000o\000n\000s}{}% 8
|
||||
\BOOKMARK [1][-]{section.6}{}{}% 9
|
||||
\BOOKMARK [1][-]{section.6}{\376\377\000R\000e\000f\000e\000r\000e\000n\000c\000e\000s}{}% 10
|
||||
\BOOKMARK [2][-]{subsection.2.4}{\376\377\000T\000r\000a\000i\000n\000i\000n\000g\000,\000\040\000v\000a\000l\000i\000d\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000t\000e\000s\000t\000\040\000s\000e\000t\000s}{section.2}% 6
|
||||
\BOOKMARK [1][-]{section.3}{\376\377\000M\000o\000d\000e\000l\000\040\000s\000e\000l\000e\000c\000t\000i\000o\000n}{}% 7
|
||||
\BOOKMARK [1][-]{section.4}{\376\377\000M\000o\000d\000e\000l\000\040\000T\000r\000a\000i\000n\000i\000n\000g\000\040\000a\000n\000d\000\040\000H\000y\000p\000e\000r\000p\000a\000r\000a\000m\000e\000t\000e\000r\000\040\000T\000u\000n\000i\000n\000g}{}% 8
|
||||
\BOOKMARK [2][-]{subsection.4.1}{\376\377\000M\000o\000d\000e\000l\000s\000\040\000a\000n\000d\000\040\000m\000e\000t\000h\000o\000d\000s\000\040\000u\000s\000e\000d}{section.4}% 9
|
||||
\BOOKMARK [2][-]{subsection.4.2}{\376\377\000V\000a\000l\000i\000d\000a\000t\000i\000o\000n\000\040\000R\000e\000s\000u\000l\000t\000s}{section.4}% 10
|
||||
\BOOKMARK [2][-]{subsection.4.3}{\376\377\000C\000a\000v\000e\000a\000t\000s\000\040\000a\000n\000d\000\040\000r\000e\000s\000t\000r\000i\000c\000t\000i\000o\000n\000s}{section.4}% 11
|
||||
\BOOKMARK [1][-]{section.5}{\376\377\000M\000o\000d\000e\000l\000\040\000E\000v\000a\000l\000u\000a\000t\000i\000o\000n\000s}{}% 12
|
||||
\BOOKMARK [2][-]{subsection.5.1}{\376\377\000A\000n\000a\000l\000y\000z\000i\000n\000g\000\040\000t\000h\000e\000\040\000C\000o\000n\000f\000u\000s\000i\000o\000n\000\040\000M\000a\000t\000r\000i\000c\000i\000e\000s}{section.5}% 13
|
||||
\BOOKMARK [2][-]{subsection.5.2}{\376\377\000A\000n\000a\000l\000y\000z\000i\000n\000g\000\040\000W\000e\000i\000g\000h\000t\000e\000d\000\040\000P\000e\000r\000f\000o\000r\000m\000a\000n\000c\000e\000\040\000M\000e\000t\000r\000i\000c\000s}{section.5}% 14
|
||||
\BOOKMARK [2][-]{subsection.5.3}{\376\377\000A\000n\000a\000l\000y\000z\000i\000n\000g\000\040\000t\000h\000e\000\040\000P\000e\000r\000f\000o\000r\000m\000a\000n\000c\000e}{section.5}% 15
|
||||
\BOOKMARK [2][-]{subsection.5.4}{\376\377\000O\000v\000e\000r\000f\000i\000t\000t\000i\000n\000g\000\040\000a\000n\000d\000\040\000U\000n\000d\000e\000r\000f\000i\000t\000t\000i\000n\000g}{section.5}% 16
|
||||
\BOOKMARK [2][-]{subsection.5.5}{\376\377\000F\000e\000a\000t\000u\000r\000e\000\040\000I\000m\000p\000o\000r\000t\000a\000n\000c\000e}{section.5}% 17
|
||||
\BOOKMARK [1][-]{section.6}{\376\377\000S\000u\000m\000m\000a\000r\000y}{}% 18
|
||||
|
||||
@@ -39,16 +39,16 @@
|
||||
|
||||
\PaperTitle{Write the title of your report here} % Article title
|
||||
|
||||
\Authors{John Smith\textsuperscript{1}*, Jennie Smith\textsuperscript{1}} % Authors
|
||||
\Authors{Petrus Einarsson\textsuperscript{1}*, Jakob Nyström\textsuperscript{1}*} % Authors
|
||||
\affiliation{\textsuperscript{1}\textit{Department of Physics, Umeå University, Umeå, Sweden}} % Author affiliation
|
||||
\affiliation{*\textbf{Corresponding author}: john@smith.com} % Corresponding author
|
||||
\affiliation{*\textbf{Supervisor}: joe@doe.com}
|
||||
\Keywords{Optics --- Interference --- Diffraction} % Keywords - if you don't want any simply remove all the text between the curly brackets
|
||||
\affiliation{*\textbf{Corresponding authors}: peei0011@student.umu.se, jany0047@student.umu.se } % Corresponding author
|
||||
\affiliation{*\textbf{Supervisor}: shahab.fatemi@umu.se}
|
||||
\Keywords{} % Keywords - if you don't want any simply remove all the text between the curly brackets
|
||||
\newcommand{\keywordname}{Keywords} % Defines the keywords heading name
|
||||
%----------------------------
|
||||
% ABSTRACT
|
||||
%----------------------------
|
||||
\Abstract{}
|
||||
\Abstract{We found a dataset that could be used for classification tasks. In order to be able to use this dataset we had to do some feature engineering, handle missing values and do some other data cleaning such as label encoding. We chose two applicable models, the Decision Tree and the Random Forst models. The dataset was divided into training, validation and testing. We tuned hyperparameters to get the best possible validation results and to avoid overfitting. When we were satisfied with our models we found that both models performed about the same with the Random Forest having about on percentage point better results but with much higher training times. We argue that the weighted accuracies of about 85\% which at a glance might seem bad, actually are reasonable given the nature of our data sets and the choices we made.}
|
||||
|
||||
%----------------------------
|
||||
\begin{document}
|
||||
@@ -67,57 +67,170 @@
|
||||
|
||||
%----------------------------
|
||||
\section{Introduction}
|
||||
Machine learning techniques have plenty of practical use cases. An example of an application is using machine learning models to estimate the salary of individuals. This can not only be practical for commercial use such as recommending relevant products to potential customers. But it can also for example be used to better understand what factors are responsible for wealth gaps within societies. In this report we find a real world dataset covering salaries of adults and train two machine learning models on it to try and get the best results possible.
|
||||
|
||||
|
||||
\section{Data analysis}
|
||||
|
||||
\subsection{Dataset}
|
||||
%https://www.kaggle.com/datasets/mosapabdelghany/adult-income-prediction-dataset
|
||||
The dataset we decided to study is a labeled income prediction dataset. This dataset includes 14 features with information about the people in the srudy and a label with the income as either more than 50 000\$ per year or less than or equal to 50 000 \$ per year. This means that we are looking at a binary classification problem. A lot of the features are discrete where only a set number of options available. This includes features such as marital status, education and working class. The dataset features around 32500 data points.
|
||||
The dataset we decided to study is a labeled income prediction dataset. This dataset includes 14 features with information about the people in the study and a label with the income as either more than \$50 000 per year or less than or equal to \$50 000 per year. This means that we are looking at a binary classification problem. A lot of the features are discrete where only a set number of options available. This includes features such as marital status, education and working class. The dataset features around 32500 data points.
|
||||
|
||||
\subsection{Data cleaning and feature engineering}
|
||||
There were a couple of things with our dataset that had to be modified in order for it to be usable in our ML application. We find that some of the features are redundant or not interesting in our project. We romove the redundant feature education since there is another already numerically encoded feature containing the same data. We also chose to remove the feature 'fnlwgt' since it is a already calculated number that is used by the Census Bureau to estimate population statistics. Since we want to estimate the population statistics based on the other features and not the already calculated weight we remove this feature. We have a mix of numerical and non-numerical features in our dataset. Since the machine learning models cannot use non-numerical data we have to encode the non-numercial data into corresponding numbers. This is with the label encoder built into sci-kit learn and used on all non-numerical data.
|
||||
There were a couple of things with our dataset that had to be modified in order for it to be usable in our ML application. We find that some of the features are redundant or not interesting in our project. We remove the redundant feature 'education' since there is another already numerically encoded feature containing the same data. We also chose to remove the feature 'fnlwgt' since it is a already calculated number that is used by the Census Bureau to estimate population statistics. Since we want to estimate the population statistics based on the other features and not the already calculated weight we remove this feature. We have a mix of numerical and non-numerical features in our dataset. Since the machine learning models cannot use non-numerical data we have to encode the non-numercial data into corresponding numbers. This is with the label encoder built into sci-kit learn and used on all non-numerical data.
|
||||
|
||||
\subsection{Handling missing values}
|
||||
With our numerical version of the dataset we found with the info function in pandas that around 2500 values were NaN values. We reasoned that filling these values with something as the mean of the category does not make very much sense for our application. Since there are many discrete categories a mean value means nothing. Especially since we gave many categories arbitrary numbers
|
||||
With our numerical version of the dataset we found with the info function in pandas that around 2500 values were NaN values. We reasoned that filling these values with something as the mean of the category does not make very much sense for our application. Since there are many discrete categories a mean value means nothing. Especially since we gave many categories arbitrary numbers the mean means nothing. We therefore decided to only use complete data points. This resulted in removing about 6\% of the total amount of data points or about 2500 data points.
|
||||
|
||||
\subsection{Training, validation and test sets}
|
||||
Before doing any sort of training or analysis on the data, se split it into training, test and validation data. We did this by first splitting a random 20\% of the data into test data. This data is reserved for the final testing of the model and will not be touched until the model is finished. Then we did a further split of the rest of the data were 25\% was designated as validation data. This data will be used for calibration of the model and hyperparameter tuning. The rest of the data which is 60\% of the total data or around 18000 data points will be used to train the model.
|
||||
|
||||
\section{Model selection}
|
||||
When selecting the model to use for this project we have to limit us to using models that are appropriate to the type of problem that we are trying to solve. The problem is a classification task so all models that are used for regression are immediately invalid. There are plenty of different types of classification models left to choose from. Many of them however, are good for data that has non-discrete features. This includes models such as logistic regression, KNN and other similar types of classification models. Also since we have so many features that are non-numerical and converted into arbitrary numbers these types of models would not be optimal. At first glance, due to the many discrete features Naïve Baye's could be a possible contender. However, the dataset also includes some continious features which complicates things. The different versions of Naïve Baye's aren't really suitable to a mix of discrete and continuous features. Therefore we are left with the tree based models such as the decision tree and random forests. We decided to implement two different types of models. We first do a decision tree and see how good we can get that model to work. We then do a random forest which may not be the absolute best model but since it is a continuation on the decision tree it might be interesting to see if it performs better. We then do analysis on both methods and see if these models are good enough and if there is any meaningful difference between the two.
|
||||
|
||||
\section{Model Training and Hyperparameter Tuning}
|
||||
\subsection{Models and methods used}
|
||||
During the model training there are some important changes we can make to improve the accuracy of our model. One of the most fundemental procedures is hyperparameter tuning which was performed inside a custom class which performs model opitmization and comparison for different models. The class handles the full workflow of tuning the hyperparameters, training the models and recording evaluation metrics. More specifically the method used for hyperparameter tuning is Scikit Learn's GridSearchCV with accuracy as the scoring metric. This method tests different combinations of hyperparameters to establish the best one's. In addition it incorporates cross-validation to prevent overfitting and increase the reliability of the results. For the cross-validation, we used Scikit Learn's stratified k-fold. This type of cross validation is beneficial to use as it preserves the percentage of samples for the classes in each fold, making the model more robust. We used 10 folds for the cross validation, there is of course no "correct" number of folds to use as it's more of a trade off between performance and computational efficiency.
|
||||
|
||||
The hyperparameters included in the grid for the decision tree were the maximum depth and the minimum sample split. The maximum depth hyperparameter decides how deep the tree is allowed to go. If a tree is allowed to go very deep there is a high risk of overfitting, on the contrary, a shallow tree will instead risk underfitting. The minimum sample split states how many data points there has to be for a new split to be created. This is also a good measure against overfitting since if it is very low we risk training the noise of the data instead of the general trend and end up overfitting the data. It is also important that it is not too small since we then loose information and underfit instead. For Random Forest the hyperparameters in the grid were maximum depth, minimum sample split and number of estimators, which decides how many trees are used in the Random Forest algorithm. % Something about XGBoost as well
|
||||
|
||||
When performing the hyperparameter tuning, we started out with a rough grid to get a decent estimate of the optimal configuration. From the resluts we then performed a finer grid around the optimal configuration. This way we where able to inspect both a wide range and a more precise range without severly increasing the computational load.
|
||||
|
||||
\subsection{Validation Results}
|
||||
Table (\ref{perfmetric}) shows the weighted averages of the performance metrics of the validation data for both models.
|
||||
|
||||
\begin{table}[!htbp]
|
||||
\centering
|
||||
\caption{The weighted averages of the performance metrics of the models on the validation data.}
|
||||
\label{perfmetric}
|
||||
\resizebox{\columnwidth}{!}{
|
||||
\begin{tabular}{c|c|c|c|c|c}
|
||||
Model&Accuracy&Precision&Recall&F1 Score&Total Time\\
|
||||
\hline
|
||||
RF &0.8589&0.8535&0.8589&0.8534&150.8154\\
|
||||
\hline
|
||||
DT&0.8483&0.8449&0.8483&0.8462&6.7357
|
||||
\end{tabular}}
|
||||
\end{table}
|
||||
|
||||
\subsection{Caveats and restrictions}
|
||||
Although the validation results produced from the script are quite promising there are a couple of important notes to make, not only to better understand the final models but also to avoid pitfalls in potential future projects. Firstly, in our script we decided to not use any standardization as this is a sort of unique case where the models used do not require it. However, it's extremely important to understand that if we were to introduce another model, we would need to standardize the data to ensure that the features contribute equally. Secondly, there are more hyperparameters that one might want to consider as we only used a few of them. The problem with expanding the number of hyperparameters in the grid is that it will exponentially increase the computational load. Therefore we picked a few that we thought were most important. Continuing, the scoring metric used is not always the best choice. We used accuracy, meaning the model tries to correctly label as many datapoints as possible and does not care about keeping a similiar precision for both labels. Our goal of this project is somewhat arbitrary, we mainly want to train and compare models. However if such a model were to be used in a real world application, one might want to change the scoring to better adapt the model to the problem at hand. % Elaborate... Secondly, there are more hyperparameters that one might want to consider... Continuing, the scoring metric used is not always the best choice. In fact, the scoring metric one should use is highly dependent on what one's goal is...
|
||||
|
||||
\begin{figure}[!h]
|
||||
\centering
|
||||
\begin{subfigure}[b]{\columnwidth}
|
||||
\centering
|
||||
\includegraphics[width=0.95\textwidth]{CM_dt.png}
|
||||
\caption{}
|
||||
\label{fig:featureImportanceDT}
|
||||
\end{subfigure}
|
||||
\hfill
|
||||
\begin{subfigure}[b]{\columnwidth}
|
||||
\centering
|
||||
\includegraphics[width=0.95\textwidth]{CM_rf.png}
|
||||
\caption{}
|
||||
\label{fig:featureImportanceRF}
|
||||
\end{subfigure}
|
||||
\caption{The confusion matricies of the Decision Tree model and the Random Forest model on the test data.}
|
||||
\label{fig:}
|
||||
\end{figure}
|
||||
|
||||
\section{Model Evaluations}
|
||||
\section{}
|
||||
There are two interesting parts to look at after our analysis. One part is to analyze how well the actual models performed and compare the difference between the two models we have chosen to study. We fine tuned our models using the validation part of the data. After running it on the test data we can see how well it actually performs. A great way to get a quick overview of how well a model classifies is to look at the confusion matrix.
|
||||
\subsection{Analyzing the Confusion Matricies}
|
||||
|
||||
|
||||
%----------------------------
|
||||
|
||||
|
||||
As we can see in the confusion matricies there is not that big of a difference between the models. Both did an overall good job at identifying the two classes. There is a difference in how well the models did in identifying the two different classes. Overall they performed a lot better at classifying the lower-earning people than the higher-earning. We can see that for the both models are pretty good at classifying the lower-earning class and worse at the higher-earning class. The Random forest model is slightly better than the Decision Tree. This is a very interesting result and maybe not so weird as it first seems. There were a lot more lower-earning people in our training data set than higher-earning people. This would of course train our model to be better at classifying the lower-earning individuals. As well as looking at the classification matricies it is interesting to look at the actual performance metrics that can be calculated from the matricies.
|
||||
\subsection{Analyzing Weighted Performance Metrics}
|
||||
We want to analyze to sets of metrics. First we have the validaton Metrics. These metrics can be seen in table (\ref{perfmetric}). Then we have the actual test metrics which is the result from our model. These can be seen in table (\ref{perfmetrictest}). Of note is that all of these metrics are calculated as weighted metrics which means that they account for the class imbalances seen in the confusion matrcies.
|
||||
|
||||
\begin{table}[!htbp]
|
||||
\centering
|
||||
\caption{The weighted averages of the performance metrics of the models on the test data.}
|
||||
\label{perfmetrictest}
|
||||
\resizebox{0.8\columnwidth}{!}{
|
||||
\begin{tabular}{c|c|c|c|c}
|
||||
Model&Accuracy&Precision&Recall&F1 Score\\
|
||||
\hline
|
||||
RF &0.86&0.86&0.86&0.86\\
|
||||
\hline
|
||||
DT &0.85&0.84&0.85&0.84
|
||||
\end{tabular}}
|
||||
\end{table}
|
||||
Looking at the values we see that the difference between our models is not that large. The Random forest model is on average about 1 percentage point better than the Decision Tree. We can also see that all metrics are at about 0.85. This means that our models are not very accurate and that the differences between them is not that large at all. Which model that is better depends a lot on what is the priority. While it is clear that the Random Forest has the better performance, even by just a little bit, it is also significanty slower on the validation data. So for this dataset was it really worth 30x the computational time to get a slightly better result? We are not really sure. The extra computational time is a definite negative but at the size of this dataset we are only talking about a couple of minutes which is not too bad. For another dataset the results may be different and it might be clearer which is really the prefered model.
|
||||
|
||||
Another thing to consider is the interpretability of the models. Here, there is quite a big difference that could possibly outweigh one model over the other. Starting with the Decision Tree, because the model's prediction process is quite simple, it is also highly interpretable. We can even plot the decision tree to see how the model handles every feature for a datapoint. This can be beneficial if we want to better understand the model. In contrast, Random Forest uses a more complicated method for prediction as it takes the averages over numerous decision trees with random subsets of features. This means that the model is more or less a black box. The importance of model interpretability is difficult to define as it will vary between different applications. Nevertheless, it's important to understand that for the better performance of Random Forest we are sacrificing a lot of interpretability. % Elaborate.
|
||||
|
||||
\subsection{Analyzing the Performance}
|
||||
Table (\ref{dt_metrics}) and (\ref{rf_metrics}) shows the class-wise metrics of the Decision Tree and Random Forest, respectively.
|
||||
|
||||
\begin{table}[!htbp]
|
||||
\centering
|
||||
\caption{Class-wise performance metrics of the Decision Tree.}
|
||||
\label{dt_metrics}
|
||||
\resizebox{0.7\columnwidth}{!}{
|
||||
\begin{tabular}{c|c|c|c}
|
||||
Class&Precision&Recall&F1 Score\\
|
||||
\hline
|
||||
Lower-earning &0.87&0.95&0.90\\
|
||||
\hline
|
||||
Higher-earning&0.77&0.56&0.65
|
||||
\end{tabular}}
|
||||
\end{table}
|
||||
|
||||
\begin{table}[!htbp]
|
||||
\centering
|
||||
\caption{Class-wise performance metrics of the Random Forest.}
|
||||
\label{rf_metrics}
|
||||
\resizebox{0.7\columnwidth}{!}{
|
||||
\begin{tabular}{c|c|c|c}
|
||||
Class&Precision&Recall&F1 Score\\
|
||||
\hline
|
||||
Lower-earning &0.89&0.94&0.91\\
|
||||
\hline
|
||||
Higher-earning&0.77&0.63&0.70
|
||||
\end{tabular}}
|
||||
\end{table}
|
||||
|
||||
|
||||
At a first glance at both the confusion matricies and the performance metrics the models do not look to be that good. But what has to be considered is the data that we are analyzing. We are looking at what possible indicators there are for a person to earn more than a certain amount of money. This is real world data and in the real world there is a lot of unique ways of earning money. While there certainly are some indicators that will clearly tell that somebody is earning a lot of money, there are other factors that are not as telling. This means that some features are less important than others. This can be seen in our models in the feature importance graphs in figure(\ref{fig:featureImportanceDT}) and (\ref{fig:featureImportanceRF}). This also means that there will be plenty of outliers in the data. No matter how good the model is, it cannot possibly catch all of these outliers. If it did it would be overfitted. We simply cannot expect a model to have very good accuracy on this type of data set.
|
||||
|
||||
An important thing to touch on is the poor fit on higher-earning people by our model. We see that both models produce a precision of 77\% on the lower-earning individuals, which is quite bad compared to the precision of 87\% and 89\% on the higher-earning individuals. This means that out of all individuals predicted as higher-earning, only 77\% are correctly predicted. Even more notably, there is a very big discrepancy on the recall between the two classes. Recalls of 56\% and 63\% for the higher-earning class compared to 95\% and 94\% shows that out of all the higher-earning individuals, the models are not good at correctly detecting them as higher-earning. Additionally, the F1-score of both classes demonstrates the discrepancy of the overall performances across the classes. It shows that the harmonic average of precision and recall is significantly lower for the lower-earning individuals than for the higher earning individuals. As we talked about above there may be many reasons for this poor fit. Of note is that we have optimized this model to find the best accuracy on all data point. We therefore stride to classify as many total data points correctly as possible and not on getting the best average for the classes separetly. Since there are more lower-earning people in our dataset it is very reasonable for the model to have optimised for that as well since it gives the best weighted accuracy. As previosly stated, the scoring metrics used for training the models should be adapted based on the problem at hand. If the problem requires similiar metrics across the classes, one should instead consider using scoring metrics such as balanced accuracy score, which are adapted to produce such results.
|
||||
|
||||
\subsection{Overfitting and Underfitting}
|
||||
We spent some time tuning the hyperparameters to ensure that we did not overfit. If we compare the validation results with the test results we see that the performance metrics do not change much at all. This is what we want to see as this means that we have avoidede overfitting the model. This means that our model could be used on other similar datasets and hopefully give similar perfomances. We also do not want our model to be underfit. This is a bit harder to validate as we want the errors to be as small as possible for both training and testing and as we stated before I believe that this is a difficult dataaset to get a great fit to. Therefore we believe that we have found a model that has a decent enough balance between bias and variance.
|
||||
|
||||
\begin{figure}[!hptb]
|
||||
\centering
|
||||
\begin{subfigure}[b]{0.85\columnwidth}
|
||||
\centering
|
||||
\includegraphics[width=\textwidth]{featureImportanceDT.png}
|
||||
\caption{}
|
||||
\label{fig:featureImportanceDT}
|
||||
\end{subfigure}
|
||||
\hfill
|
||||
\begin{subfigure}[b]{0.85\columnwidth}
|
||||
\centering
|
||||
\includegraphics[width=\textwidth]{featureImportanceRF.png}
|
||||
\caption{}
|
||||
\label{fig:featureImportanceRF}
|
||||
\end{subfigure}
|
||||
\caption{The feature importance graphs for the Decision Tree model and the Random Forest model based on the validation data.}
|
||||
\label{fig:}
|
||||
\end{figure}
|
||||
|
||||
\subsection{Feature Importance}
|
||||
Taking a closer look at the feature importance graphs of the two models we notice an interesting difference. The Decision tree which is only one tree focuses has only a few main features where one is the most important. The rest are not used that much or almost not at all. The Random Forest uses a far wider range of features. They also rank the features a bit differently and the best feature for one model is not the best for the other. We considered removing the worst performing features to see if it would make a difference in the performacnes. But since they have different results for the worst performing features we reasoned that to keep the comparison as fair as possible it would be more interesting to leave the features as is.
|
||||
|
||||
|
||||
\section{Summary}
|
||||
We have succesfully trained two different but similar machine learning models on classifying the monetary status of people based on a bunch of different features. To avoid help overfitting, find optimal hyperparameters and generally produce a more reliable performance estimate, we performed a grid search combined with cross-validation on our data. Optimizing the models to produce the best accuracies generated a decent result for that specific metric. However, we did find that our models instead performed worse for the other metrics. Since we did not consider a specific application for model, we argue that the scoring metric should instead be adapted based on one's specific goal.
|
||||
%---------
|
||||
% REFERENCE LIST
|
||||
%----------------------------
|
||||
\bibliographystyle{model1-num-names}
|
||||
\begin{thebibliography}{4}
|
||||
\bibitem{Steinhaus:Mathematical}
|
||||
Steinhaus, H.,
|
||||
Mathematical Snapshots,
|
||||
3rd Edition. New York: Dover, pp. 93-94,
|
||||
(1999)
|
||||
|
||||
\bibitem{Greivenkamp:FieldGuide}
|
||||
Greivenkamp,
|
||||
J. E., Field Guide to Geometrical Optics,
|
||||
SPIE Press,
|
||||
Bellingham, WA,
|
||||
(2004)
|
||||
|
||||
\bibitem{Pedrotti:Introduction}
|
||||
Pedrotti, F.L. and Pedrotti, L.S.,
|
||||
Introduction to Optics,
|
||||
3rd Edition,
|
||||
Addison-Wesley,
|
||||
(2006)
|
||||
|
||||
\bibitem{Davis:ChemWiki}
|
||||
UC Davis ChemWiki,
|
||||
Propagation of Error,
|
||||
Available at: \url{https://chem.libretexts.org/Textbook_Maps/Analytical_Chemistry/Supplemental_Modules_(Analytical_Chemistry)/Quantifying_Nature/Significant_Digits/Propagation_of_Error},
|
||||
(Accessed: 10th March 2016).
|
||||
\end{thebibliography}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,18 @@
|
||||
\contentsline {section}{\numberline {2}Data analysis}{1}{section.2}%
|
||||
\contentsline {subsection}{\numberline {2.1}Dataset}{1}{subsection.2.1}%
|
||||
\contentsline {subsection}{\numberline {2.2}Data cleaning and feature engineering}{1}{subsection.2.2}%
|
||||
\contentsline {subsection}{\numberline {2.3}Handling missing values}{1}{subsection.2.3}%
|
||||
\contentsline {section}{\numberline {3}Model selection}{1}{section.3}%
|
||||
\contentsline {section}{\numberline {4}Model Training and Hyperparameter Tuning}{1}{section.4}%
|
||||
\contentsline {section}{\numberline {5}Model Evaluations}{1}{section.5}%
|
||||
\contentsline {section}{\numberline {6}}{1}{section.6}%
|
||||
\contentsline {section}{References}{1}{section.6}%
|
||||
\contentsline {subsection}{\numberline {2.3}Handling missing values}{2}{subsection.2.3}%
|
||||
\contentsline {subsection}{\numberline {2.4}Training, validation and test sets}{2}{subsection.2.4}%
|
||||
\contentsline {section}{\numberline {3}Model selection}{2}{section.3}%
|
||||
\contentsline {section}{\numberline {4}Model Training and Hyperparameter Tuning}{2}{section.4}%
|
||||
\contentsline {subsection}{\numberline {4.1}Models and methods used}{2}{subsection.4.1}%
|
||||
\contentsline {subsection}{\numberline {4.2}Validation Results}{2}{subsection.4.2}%
|
||||
\contentsline {subsection}{\numberline {4.3}Caveats and restrictions}{2}{subsection.4.3}%
|
||||
\contentsline {section}{\numberline {5}Model Evaluations}{3}{section.5}%
|
||||
\contentsline {subsection}{\numberline {5.1}Analyzing the Confusion Matricies}{3}{subsection.5.1}%
|
||||
\contentsline {subsection}{\numberline {5.2}Analyzing Weighted Performance Metrics}{3}{subsection.5.2}%
|
||||
\contentsline {subsection}{\numberline {5.3}Analyzing the Performance}{4}{subsection.5.3}%
|
||||
\contentsline {subsection}{\numberline {5.4}Overfitting and Underfitting}{4}{subsection.5.4}%
|
||||
\contentsline {subsection}{\numberline {5.5}Feature Importance}{4}{subsection.5.5}%
|
||||
\contentsline {section}{\numberline {6}Summary}{5}{section.6}%
|
||||
\contentsfinish
|
||||
|
||||
BIN
Report/confusionMatrix.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Report/featureImportanceDT.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
Report/featureImportanceRF.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
\Report\CM_dt.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
\Report\CM_rf.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
\Report\CM_xgb.png
Normal file
|
After Width: | Height: | Size: 86 KiB |