-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In MLJ interface, classifier makes unordered class predictions for ordered training target #267
Comments
Would you have an example of a library implementing that support for OrderedFactor predictions? |
Something like this: import CategoricalDistributions as CD
using CategoricalArrays
y = categorical(collect("abbba"), ordered=true)
# store the following as part of learned parameters
L = CD.classes(y)
# 2-element CategoricalArray{Char,1,UInt32}:
# 'a'
# 'b'
isordered(L)
# true
# at prediction time:
probs = rand(5)
yhat = CD.UnivariateFinite(L, probs, augment=true)
# 5-element UnivariateFiniteVector{OrderedFactor{2}, Char, UInt32, Float64}:
# UnivariateFinite{OrderedFactor{2}}(a=>0.758, b=>0.242)
# UnivariateFinite{OrderedFactor{2}}(a=>0.661, b=>0.339)
# UnivariateFinite{OrderedFactor{2}}(a=>0.993, b=>0.00658)
# UnivariateFinite{OrderedFactor{2}}(a=>0.748, b=>0.252)
# UnivariateFinite{OrderedFactor{2}}(a=>0.182, b=>0.818)
|
Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: