Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

Commit a4cc1bc

Browse files
authored
Fix typos on report (#5)
1 parent 8ad946b commit a4cc1bc

3 files changed

Lines changed: 65 additions & 67 deletions

File tree

report/HW1.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
\end{equation}
183183

184184
Since there are \textbf{7 observations where \(y_1 = A\)}, \textbf{5 of which are positive} while \textbf{2 of which are negative},
185-
while remaining \textbf{13 observations have \(y_1 = B\)}, where \textbf{6 are positive} and \textbf{7 are negative},
185+
while the remaining \textbf{13 observations have \(y_1 = B\)}, where \textbf{6 are positive} and \textbf{7 are negative},
186186

187187
\[
188188
\begin{aligned}
@@ -237,11 +237,11 @@
237237
From the obtained results, we noticed that the training accuracy is always 1, regardless of the number of selected features.
238238
This is a result of how decision trees learn.
239239

240-
Since the question prompt tells us the decision tree does not have a depth limit, a decision tree that perfectly fits all the training data (\texttt{X\_train}) can be created.
241-
Therefore, after the tree is trained, if we give the training set (\texttt{X\_train}) as the data set to test its accuracy, it'll know the correct path for all of the observations and knows how to classify them.
240+
Since the question prompt tells us the decision tree does not have a depth limit, a decision tree that perfectly fits all the training data (\texttt{X\_train\_cut}) can be created.
241+
Therefore, after the tree is trained, if we give the training set (\texttt{X\_train\_cut}) as the data set to test its accuracy, it'll know the correct path for all of the observations and knows how to classify them.
242242
This results in an accuracy of 1.
243243

244-
However, if we test the model with a data set that it hasn't been trained on (\texttt{X\_test}), we see its accuracy slightly decreases to around 0.8.
244+
However, if we test the model with a data set that it hasn't been trained on (\texttt{X\_test\_cut}), we see its accuracy slightly decreases to around 0.8.
245245
This happens because it has never seen those observations before, so it might have leaves that are not expanded enough to accurately classify them.
246246

247247
Furthermore, we can also notice that the accuracy of the decision tree changes with the number of features.

report/assets/hw1-plot.svg

Lines changed: 54 additions & 56 deletions
Loading

src/hw1/HW1.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@
311311
"source": [
312312
"NUM_FEATURES = [5, 10, 40, 100, 250, 700]\n",
313313
"\n",
314-
"training_accurancy = []\n",
315-
"test_accurancy = []\n",
314+
"training_accuracy = []\n",
315+
"test_accuracy = []\n",
316316
"\n",
317317
"for num_features in NUM_FEATURES:\n",
318318
" # Select the features with the greatest information gain (by mutual_info_classif)\n",
@@ -340,8 +340,8 @@
340340
" train_acc = metrics.accuracy_score(y_train, y_train_pred)\n",
341341
" test_acc = metrics.accuracy_score(y_test, y_test_pred)\n",
342342
"\n",
343-
" training_accurancy.append(train_acc)\n",
344-
" test_accurancy.append(test_acc)"
343+
" training_accuracy.append(train_acc)\n",
344+
" test_accuracy.append(test_acc)"
345345
]
346346
},
347347
{
@@ -352,13 +352,13 @@
352352
"source": [
353353
"plt.plot(\n",
354354
" NUM_FEATURES,\n",
355-
" training_accurancy,\n",
356-
" label=\"Training Accuraccy\",\n",
355+
" training_accuracy,\n",
356+
" label=\"Training Accuracy\",\n",
357357
" marker=\"+\",\n",
358358
" color=\"#4caf50\",\n",
359359
")\n",
360360
"plt.plot(\n",
361-
" NUM_FEATURES, test_accurancy, label=\"Test Accuraccy\", marker=\".\", color=\"#ff5722\"\n",
361+
" NUM_FEATURES, test_accuracy, label=\"Test Accuracy\", marker=\".\", color=\"#ff5722\"\n",
362362
")\n",
363363
"\n",
364364
"plt.xlabel(\"Number of Selected Features\")\n",

0 commit comments

Comments
 (0)