Skip to content

Conversation

@aaryanideas28
Copy link

Hi, I am Aaryan Johri, a first-year Computer Science student at VJTI, Mumbai.

This pull request addresses Issue #341 by extending the confusionmat function to support non-numeric data types, specifically string cell arrays and categorical arrays.

Technical Changes:
Added a new elseif conditional block (around Line 194) to detect isstring and iscategorical inputs.
Implemented a mapping logic using the union function to identify all unique classes across both actual and predicted sets.
Utilized find and indexing to populate the confusion matrix based on these identified labels, ensuring correct counts even for non-numeric data.

Verification & Testing:
Successfully verified the fix in GNU Octave using cell arrays of strings, producing the expected 2 X 2 matrix for unbalanced classes. Ran the internal test suite using test confusionmat to confirm that existing numeric functionality remains unaffected .I look forward to any feedback or suggestions for improvement.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant