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 traits for custom measures (and later contribute for general use) #44

Open
pat-alt opened this issue Dec 6, 2022 · 1 comment
Open
Assignees
Labels
enhancement New feature or request medium This is expected to be medium.

Comments

@pat-alt
Copy link
Member

pat-alt commented Dec 6, 2022

    @pat-alt Great to hear about your progress!

Q1: Firstly, should I extend MMI.evaluate to assert that users only use one of the two applicable custom measures?

Generally the kind of target proxy the measure is used for is articulated with the prediction_type trait. (Measures have traits, just like models. The manual mentions this, but you'll want to look also here if you're contributing new measures.) So, you would do something like:

StatisticalTraits.prediction_type(::Type{<:YourMeasureType}) = :probablisitic_set

edited: The model version of this trait is already suitably overloaded here:

https://github.com/JuliaAI/MLJModelInterface.jl/blob/d9e9703947fc04b0a5e63680289e41d0ba0d65bd/src/model_traits.jl#L27

The evaluate apparatus in MLJBase should check the model matches the measure and throw an error if it doesn't. Possibly, as this is a new target proxy type, the behaviour at MLJBase may need to be adjusted. The relevant logic lives approximately here:

https://github.com/JuliaAI/MLJBase.jl/blob/d79f29b78c5068377e25363884e2ea1c4b4a149a/src/resampling.jl#L600

Q2:

Do you always see this rubbish, or just for your custom measure? Where are you viewing this? Is it in an ordinary terminal or VSCode, notebook, other? Could you please try MLJ.color_off() and see if that helps?

Originally posted by @ablaom in #40 (comment)

@pat-alt pat-alt added enhancement New feature or request easy This is expected to be easy. labels Dec 6, 2022
@pat-alt pat-alt self-assigned this Dec 6, 2022
@pat-alt pat-alt added medium This is expected to be medium. and removed easy This is expected to be easy. labels Dec 6, 2022
@ablaom
Copy link

ablaom commented Dec 6, 2022

I'd support including your measures at MLJBase/src/measures.jl . BTW, the intention is to make measures are stand-alone package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium This is expected to be medium.
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants