ageron / ageron/handson-ml

Exercise 3 relative errors in conf. matrix

Open
#303 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
25.6k
Forks
12.7k
PR merge metrics
No merged PRs in 30d

Description

Considering the MNIST dataset, wich has 5923 instances of the 0 class in the training set, I'm alittle confused about the following code for detemining the relative errors of the SGD classification model:

`row_sums = conf_mx.sum(axis=1, keepdims=True)`
`norm_conf_mx = conf_mx / row_sums`

(https://github.com/ageron/handson-ml/blob/master/03_classification.ipynb // In: 67)

Since using `axis=1` returns a vector containing the results of the sum of the ROWS in the conf. Matrix, and the rows actually represent the real class of the instances, which in turn results in 6035 for the 0 class (when in reality there are only 5923 real 0 instances)

I think the code should use `axis=0`.

Please correct me if I'm wrong.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.