Mlj.jl: Add default_measure to learning_curve!

Created on 21 Oct 2019  路  6Comments  路  Source: alan-turing-institute/MLJ.jl

In learning_curve! (but not only there) you can specify a measure which, by default, is set to rms; however if you leave it to default and try to do this on a classifier you'll get an error.

It would be easy to change so that it takes a reasonable default measure for the type of model something like

function learning_curve!(mach::Machine{<:Supervised};
                         resolution=30, resampling=Holdout(),
                         measure=default_measure(mach), operation=predict,
                         range=nothing, verbosity=1, n=1)

where default_measure returns for instance either rms or cross_entropy or some such based on what type of input it gets

easy enhancement good first issue

Most helpful comment

Your welcome. Kudos for the tutorials goes in large part to @tlienart.

All 6 comments

Actually, there is already a default_measure(model) function, defined in MLJBase/src/measures.jl, which uses the scientific type of the target to determine a sensible default. So,

function learning_curve!(mach::Machine{<:Supervised};
                         resolution=30, resampling=Holdout(),
                         measure=default_measure(mach.model), operation=predict,
                         range=nothing, verbosity=1, n=1)

ought to do it.

Hello,

Can someone confirm whether the MLJ.learning_curve! function has been deprecated?
I cannot find this function from MLJ documentation 0.3.0 onward.
So I checked 0.3.0 release notes, but couldn't find a deprecation announcement.

Thank you!

Yes, good catch, thanks. It is not in the manual, will address this.

https://github.com/alan-turing-institute/MLJ.jl/issues/362

There is a docstring, so you can do ?learning_curve! at the REPL. And there is a demo at https://alan-turing-institute.github.io/MLJTutorials/pub/getting-started/ensembles-2.html

Thank you so much Dr. Anthony!
Yes, I have been working on the Tutorials since you provided me with the links.
Your tutorials are so informative and helpful, and I am glad they are available in various formats.
Great work!

Your welcome. Kudos for the tutorials goes in large part to @tlienart.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mllg picture mllg  路  6Comments

tlienart picture tlienart  路  4Comments

tlienart picture tlienart  路  7Comments

azev77 picture azev77  路  6Comments

juliohm picture juliohm  路  7Comments