Last answered:

03 Jul 2023

Posted on:

02 Jul 2023

0

confusion matrix

how does the histogram2d functions here?

1 answers ( 0 marked as helpful)
Instructor
Posted on:

03 Jul 2023

0

Hey Niranjan,


Thank you for reaching out!


The histogram2d function works as follows. Imagine a 2D coordinate system. The first parameter (actual_values) is  plotted along the y-axis, while the second parameter (pred_values) is plotted along the x-axis. Then, imagine that tick marks are placed at 0.0, 0.5, and 1.0 on each of the axes. These tick marks mark the edges of the two bins, namely

- a bin between the values 0.0 and 0.5

- a bin between the values 0.5 and 1.0

This splits the screen into four sectors. Just as in a conventional 1-dimensional histogram, in this 2-dimensional version we count the number of occurances in each sector. The resulting histogram has become our confusion matrix.


For further information, please refer to the function's official documentation:

https://numpy.org/doc/stable/reference/generated/numpy.histogram2d.html

Kind regards,

365 Hristina

Submit an answer