Closed hollyhutson closed 2 months ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.
Environment
1.8.13
Steps to reproduce
Use a
SlicedClassificationMetrics
Artifact and try to callload_confusion_matrix
. Internally this callslog_confusion_matrix_cell
on theClassificationMetrics
object instead oflog_confusion_matrix
, which results in a type error:TypeError: log_confusion_matrix_cell() missing 1 required positional argument: 'value'
Expected result
Calling
load_confusion_matrix
onSlicedClassificationMetrics
doesn't break, and correctly adds the confusion matrix to the right slice in the metadata.Materials and Reference
Full reproducible sample:
See the incorrect line of code here: https://github.com/kubeflow/pipelines/blob/061905b6df397c40fbcc4ffafa24d7b3b9daf439/sdk/python/kfp/components/types/artifact_types.py#L452-L464 Where
self._sliced_metrics[slice].log_confusion_matrix_cell( categories, matrix)
Should beself._sliced_metrics[slice].log_confusion_matrix( categories, matrix)
Sinceself._sliced_metrics[slice]
is of typeClassificationMetrics
after the call toself._upsert_classification_metrics_for_slice(slice)
As an aside -
_sliced_metrics
is never initialised in the class, leaving it up to the user of the Artifact class, which isn't very intuitive.Impacted by this bug? Give it a 👍.