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

[MLForecast] Add the possibility to pass custom parameters to the fit function #322

Closed
helderPereira22 opened this issue Mar 1, 2024 · 6 comments

Comments

@helderPereira22
Copy link

Description

Enable the ability to pass custom parameters (for instance with kwargs) for the fit function of the model

Use case

For instance, to use the Overfitting detector of the Catboost algorithm (where we pass 'early_stopping_rounds' to the fit function)

@jmoralez
Copy link
Member

jmoralez commented Mar 1, 2024

Hey @helderPereira22, thanks for using mlforecast. I believe you can achieve that following this guide.

Please let us know if that doesn't work for you.

@helderPereira22
Copy link
Author

Hello @jmoralez!

I think it works! But do I lose any of the Nixtla capabilities by doing this?

@jmoralez
Copy link
Member

jmoralez commented Mar 2, 2024

All we do with the trained models is call predict, so it should work exactly in the same way.

@helderPereira22
Copy link
Author

Hello @jmoralez,

For instance, adopting the custom training approach you recommended means I wouldn't have the ability to employ Conformal Prediction for creating prediction intervals. Therefore, it seems I would be sacrificing this feature by not applying the .fit method provided by Nixtla.

Could you take this into account?

@jmoralez
Copy link
Member

jmoralez commented Apr 8, 2024

The intervals are created by performing cross validation, so if you were to set the early stopping rounds you'd end up with a potentially different number of iterations in each fold. My suggestion is to run it once (maybe with all of your data), check which iteration was the best and then fix that value in the catboost constructor and use the regular MLForecast.fit, that way when computing the intervals each fold will use the same number of iterations.

Copy link
Contributor

github-actions bot commented May 9, 2024

This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one.

@github-actions github-actions bot closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants