Skip to content

confusion matrix: Problem with perm=... #170

@ablaom

Description

@ablaom

When using confmat(yhat, y, perm=[3,2,1] the matrix entries seem to change but the labels begin shown are not adjusted:

X, y = @load_iris;
y=coerce(y, OrderedFactor);
tree = @load SVC
treeM = machine(tree, X, y)
fit!(treeM)
yhat = predict(treeM, X);

julia> confmat(yhat, y)
              ┌─────────────────────────────────────────┐
              │              Ground Truth               │
┌─────────────┼─────────────┬─────────────┬─────────────┤
│  Predicted  │   setosa    │  versicol  │  virginica  │
├─────────────┼─────────────┼─────────────┼─────────────┤
│   setosa    │     5000      │
├─────────────┼─────────────┼─────────────┼─────────────┤
│  versicol0480      │
├─────────────┼─────────────┼─────────────┼─────────────┤
│  virginica  │      0250      │
└─────────────┴─────────────┴─────────────┴─────────────┘


julia> confmat(yhat, y, perm=[3, 2, 1])
              ┌─────────────────────────────────────────┐
              │              Ground Truth               │
┌─────────────┼─────────────┬─────────────┬─────────────┤
│  Predicted  │   setosa    │  versicol  │  virginica  │
├─────────────┼─────────────┼─────────────┼─────────────┤
│   setosa    │     5020      │
├─────────────┼─────────────┼─────────────┼─────────────┤
│  versicol0480      │
├─────────────┼─────────────┼─────────────┼─────────────┤
│  virginica  │      0050      │
└─────────────┴─────────────┴─────────────┴─────────────┘

I'm guessing the same is true for rev=... in the binary case.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdone

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions