comet-ml / issue-tracking

Questions, Help, and Issues for Comet ML
https://www.comet.ml
85 stars 7 forks source link

Feature Request: non square Confusion Matrix #412

Closed Zadagu closed 1 year ago

Zadagu commented 3 years ago

Hi, I would like to upload non square confusion matrixes.

Why do I need it? I have more than 100 classes and I want to focus on some key classes, which tend to be confused. I create a matrix containing all classes and take the rows and columns for the ones i'm interested in. This sub matrix will be extended by a "remaining" column, which is a sum over all other columns. so i get a m by m+1 matrix which I would like to log.

What needs to be done?

  1. The to_json method of ConfusionMatrix throws an error, when dimensions doesn't match:

    Traceback (most recent call last):
    File "/utility.py", line 99, in report_to_comet
    print(repr(ccm.to_json()))
    File "site-packages/comet_ml/confusion_matrix.py", line 657, in to_json
    matrix = self._get_matrix()
    File "site-packages/comet_ml/confusion_matrix.py", line 540, in _get_matrix
    matrix = self._expand_dict(self._matrix, default=0)
    File "site-packages/comet_ml/confusion_matrix.py", line 562, in _expand_dict
    matrix[x][y] = matrix_dict[(x, y)]
    IndexError: list assignment index out of range
  2. The init function of ConfusionMatrix should use the maximum number of lines and columns, when checking the size of the column labels.

Kind regards, Zadagu

dsblank commented 3 years ago

Hello @Zadagu ! I think you can already do partially what you request by using the selected option to the confusion matrix. Although that still creates a square matrix, it allows you to select a subset of categories.

Does that help?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.