Skip to content
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

Add promote rule for the type of raw probabilities #37

Open
ablaom opened this issue Oct 17, 2022 · 1 comment
Open

Add promote rule for the type of raw probabilities #37

ablaom opened this issue Oct 17, 2022 · 1 comment

Comments

@ablaom
Copy link
Member

ablaom commented Oct 17, 2022

using CategoricalDistributions
d1 = UnivariateFinite([0.2, 0.3])
d2 = UnivariateFinite([Float32(0.2), Float32(0.3)]);
v = [d1, d2];
julia> typeof.(v)
2-element Vector{DataType}:
 UnivariateFinite{Multiclass{2}, String, UInt8, Float64}
 UnivariateFinite{Multiclass{2}, String, UInt8, Float32}
julia> eltype(v)
UnivariateFinite{Multiclass{2}, String, UInt8}

What the last line in the code snippet above "should" be is UnivariateFinite{Multiclass{2}, String, UInt8, Float64}, which a promote_rule "lifting" promotion in P will do, right?

@ablaom
Copy link
Member Author

ablaom commented Oct 17, 2022

This will resolve JuliaAI/MLJBase.jl#835 .

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

No branches or pull requests

1 participant