skjerns / AutoSleepScorer

An open-source sleep stage classification Python package
GNU Affero General Public License v3.0
104 stars 22 forks source link

Confusion Matrix #29

Closed madhhir closed 2 years ago

madhhir commented 2 years ago

screenshot

Can you please explain the parameters passed to this function for obtaining the confusion matrix for this model?

skjerns commented 2 years ago
fname = filename where the png will be saved
conf_mat = the confusion matrix itself, i.e. a square matrix obtained by `https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html`
target_names = a list of strings with the names corresponding to the specific prediction label

However, I recommend to simply use any other confusion matrix plotting function instead of mine, for example https://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html

or https://stackoverflow.com/questions/35572000/how-can-i-plot-a-confusion-matrix

gsamyak30 commented 2 years ago

Hi Simon

For Plotting a confusion matrix we require a square matrix but like how can we make a square matrix from the dataset as the data are in the csv format and they are very long entries data so do you apply any code for making matrix or you have just done mannualy ?