I’m working on a multi-class labeling task and am doing batch prediction on held out test data for which I have labels, along these lines:
inflearn = load_learner(test=testdata.valid_ds.x)
preds,y = inflearn.get_preds(ds_type=DatasetType.Test)
Unfortunately, y
is not an array of one-hot encoded categories of the same shape as preds
, which would be easier to work with.
The corresponding mult-category labels in testdata.valid_ds.y
are a MultiCategoryList
, which doesn’t seem to have a method for converting its items into an array that can serve as truth to compare against the preds
.
I don’t see this common use case addressed in the docs. I’m sure I can cobble something together, but wonder if there’s a better, preferably built-in approach, or if anyone has advice on how to proceed.
Thanks!