Skip to content
Snippets Groups Projects
Commit a69da187 authored by Felix Ramnelöv's avatar Felix Ramnelöv
Browse files

Lab 1: Note fix

parent e3f9949b
No related branches found
No related tags found
No related merge requests found
......@@ -45,18 +45,18 @@ Confusion matrix o missclassification error e framtana.
4. The complexity is the highest when $k$ is the lowest and decreases when we increase $k$ (as seen in the graph when the training error increases with an increasing $k$). Optimal $k$ when the validation error is minimum, when $k = 3$.
Formula: $R(Y, \hat{Y}) = \frac{1}{N} \sum_{i=1}^{N} I(Y_i \neq \hat{Y}_i)$
![Missclassification rate depending on k](./assignment1-4.png)
Formula: $$R(Y, \hat{Y}) = \frac{1}{N} \sum_{i=1}^{N} I(Y_i \neq \hat{Y}_i)$$
Test error ($k = 3$): $0.02403344$. Higher than the training error but slightly lower than the validation error. According to us it is a pretty good model considering that it correct $\approx 98 \%$ of times.
5. Optimal $k = 6$, when the average cross-entropy loss is the lowest. Average cross-entropy loss takes probabilities in the prediction into account which is a better represntation of a model with multionmial distribution. An important aspect is that we can determina how wrong a classification is, not just wether it is wrong or not.
Formula: $R(Y, \hat{p}(Y)) = - \frac{1}{N} \sum_{i=1}^{N} \sum_{m=1}^{M} I(Y_i = C_m) \log \hat{p}(Y_i = C_m)$
![Average cross-entropy loss depending on k](./assignment1-5.png)
Formula: $$R(Y, \hat{p}(Y)) = - \frac{1}{N} \sum_{i=1}^{N} \sum_{m=1}^{M} I(Y_i = C_m) \log \hat{p}(Y_i = C_m)$$
## Assignment 2
2. In the estimation summary shown bellow we can see our features ordered by significance. Here DFA is the most significant.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment