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

Adding RMSE With Uncertainty loss to CatBoost #1044

Merged
merged 31 commits into from
Jul 6, 2022

Conversation

jonasracine
Copy link
Contributor

@jonasracine jonasracine commented Jun 27, 2022

In this PR, CatBoostModel and RegressionModel were modified to support CatBoost's RMSE With Uncertainty loss function.

With this loss, CatBoost output not a single value but a [mean, variance] list. Most of the work here was concerned with wrangling output shapes, especially in the multivariate case and with output chunks > 1.

This PR depends on the original CatBoost PR and should be merged after it.

@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2022

Codecov Report

Merging #1044 (34f7094) into master (7c436da) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1044      +/-   ##
==========================================
+ Coverage   91.35%   91.39%   +0.04%     
==========================================
  Files          78       78              
  Lines        7931     7941      +10     
==========================================
+ Hits         7245     7258      +13     
+ Misses        686      683       -3     
Impacted Files Coverage Δ
darts/models/forecasting/catboost_model.py 100.00% <100.00%> (+5.55%) ⬆️
darts/models/forecasting/regression_model.py 97.48% <100.00%> (+0.24%) ⬆️
darts/models/__init__.py 86.36% <0.00%> (-0.31%) ⬇️
darts/timeseries.py 92.04% <0.00%> (-0.07%) ⬇️
...arts/models/forecasting/torch_forecasting_model.py 89.51% <0.00%> (-0.05%) ⬇️
darts/models/forecasting/block_rnn_model.py 98.14% <0.00%> (-0.04%) ⬇️
darts/models/forecasting/nhits.py 99.25% <0.00%> (-0.01%) ⬇️
darts/datasets/__init__.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c436da...34f7094. Read the comment docs.

@jonasracine jonasracine linked an issue Jun 28, 2022 that may be closed by this pull request
darts/models/forecasting/catboost_model.py Outdated Show resolved Hide resolved
darts/models/forecasting/regression_model.py Outdated Show resolved Hide resolved

model_output = self.model.predict(x, **kwargs)
output_dim = len(model_output.shape)
chunk_len = self.output_chunk_length
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend you get rid of this variable and simply use self.output_chunk_length.

darts/models/forecasting/regression_model.py Show resolved Hide resolved
darts/models/forecasting/regression_model.py Outdated Show resolved Hide resolved
darts/models/forecasting/regression_model.py Show resolved Hide resolved
darts/models/forecasting/regression_model.py Outdated Show resolved Hide resolved
darts/models/forecasting/regression_model.py Show resolved Hide resolved
darts/models/forecasting/regression_model.py Outdated Show resolved Hide resolved
darts/models/forecasting/regression_model.py Outdated Show resolved Hide resolved
@hrzn
Copy link
Contributor

hrzn commented Jun 30, 2022

So in view of the tutorial you posted, what sort of "knowledge uncertainty" is this version capturing? It'd be nice to document this.

Copy link
Contributor

@hrzn hrzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@jonasracine jonasracine merged commit 12c3702 into master Jul 6, 2022
@madtoinou madtoinou deleted the feat/rmse-uncertainty-catboost branch July 5, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RMSEWithUncertainty likelihood to catboost model
3 participants