laresbernardo / lares

Analytics & Machine Learning R Sidekick
https://laresbernardo.github.io/lares/
233 stars 49 forks source link

Can the target of categorical numeric variable to be treated as "regression" target #38

Closed ferrenlove closed 2 years ago

ferrenlove commented 2 years ago

Hi, I have a target variable which value is " 1, 2, 3, 4, 5" only. When I use the h2o_automl function, it always treat is as multi class target and run classification on it. I want to run it as regression but fail so many times. Can you please add some options in the syntax to choose the target variable as " binary, multiclass, or regression?

Thank you!

laresbernardo commented 2 years ago

Hey @ferrenlove glad you asked. There is already a parameter, thresh, which was built specifically to control this behavior. By default, if it finds less than 10 unique values, it treats your model as a classification model, regardless of the data type on the target variable. You can change that value to, say, thresh = 1 and should work just fine. I'm sure you know what you are doing here and I have no context on your case, but considering treating your dependent variable as a categorical variable may actually be a viable option. Cheers.

ferrenlove commented 2 years ago

Thank you so much! Just tried and it worked! I have used H2o for long time but it is my 2nd day to use your package, really powerful!

laresbernardo commented 2 years ago

Happy to help! Feel free to share with me any feedback :)