parsnip icon indicating copy to clipboard operation
parsnip copied to clipboard

Document details on null_model

Open jxu opened this issue 2 years ago • 3 comments

https://parsnip.tidymodels.org/reference/null_model.html

There are several different plausible null models. For classification, besides predicting the majority class, there is also uniform random guessing, and selecting a class from a random input observation. See https://machinelearningmastery.com/how-to-develop-and-evaluate-naive-classifier-strategies-using-probability/

I'm not saying these need to be supported, but I had to look into the source code to see what is actually being fit. The source code clearly says "Fit a single mean or largest class model.", so this should be documented.

jxu avatar Oct 27 '23 16:10 jxu

Hello @jxu 👋

thanks for raising this issue, the documentation is indeed quite sparse

EmilHvitfeldt avatar Oct 27 '23 16:10 EmilHvitfeldt

I can open a PR if you'd like. I assume https://github.com/tidymodels/parsnip/blob/907d2164a093f10cbbc1921e4b73264ca4053f6b/R/nullmodel.R#L1 is for nullmodel while https://github.com/tidymodels/parsnip/blob/907d2164a093f10cbbc1921e4b73264ca4053f6b/R/nullmodel.R#L128 is for null_model? The naming is a bit confusing.

jxu avatar Oct 27 '23 18:10 jxu

it is for the second one! https://github.com/tidymodels/parsnip/blob/HEAD/R/nullmodel.R#L128-L145

Yes the naming is a pain, but this is the only model that is define inside a parsnip package and making the names work with dispatch caused a bit of trouble.

if you are up for a PR go ahead!

EmilHvitfeldt avatar Oct 27 '23 18:10 EmilHvitfeldt

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

github-actions[bot] avatar Oct 04 '25 01:10 github-actions[bot]