Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Enhance testcases for mx.metric.PCC.
Browse files Browse the repository at this point in the history
  • Loading branch information
tlby committed Jul 21, 2019
1 parent 5a67cc4 commit 6a77c71
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/python/unittest/test_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ def test_pcc():
_, pear = met_pear.get()
np.testing.assert_almost_equal(pcc, pear)

# pcc should accept pred as scalar rather than softmax vector like
# Accuracy does
met_pcc.reset()
met_pcc.update(labels, [p.argmax(axis=1) for p in preds])
_, tst = met_pear.get()
np.testing.assert_almost_equal(pcc, tst)

# check multiclass case against reference implementation
CM = [
[ 23, 13, 3 ],
Expand Down

0 comments on commit 6a77c71

Please sign in to comment.