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

Feat/hyperparameter opt guide #1242

Merged
merged 14 commits into from
Sep 28, 2022
Merged

Feat/hyperparameter opt guide #1242

merged 14 commits into from
Sep 28, 2022

Conversation

hrzn
Copy link
Contributor

@hrzn hrzn commented Sep 24, 2022

  • New notebook showcasing an example of hyperparameter search with Optuna
  • New section in user guide on hyperparameter search

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2022

Codecov Report

Base: 93.88% // Head: 93.87% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (b7c6e2b) compared to base (06824b2).
Patch has no changes to coverable lines.

❗ Current head b7c6e2b differs from pull request most recent head 4ce62ef. Consider uploading reports for the commit 4ce62ef to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1242      +/-   ##
==========================================
- Coverage   93.88%   93.87%   -0.01%     
==========================================
  Files          73       73              
  Lines        8097     8085      -12     
==========================================
- Hits         7602     7590      -12     
  Misses        495      495              
Impacted Files Coverage Δ
darts/timeseries.py 92.34% <0.00%> (-0.06%) ⬇️
...arts/models/forecasting/torch_forecasting_model.py 87.45% <0.00%> (-0.05%) ⬇️
darts/models/forecasting/block_rnn_model.py 98.24% <0.00%> (-0.04%) ⬇️
darts/models/forecasting/nhits.py 99.27% <0.00%> (-0.01%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

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

Really cool stuff, thanks @hrzn !
Just added a few minor suggestions.
P.s. I wonder why TCNModel performs worse with the dayofweek cyclic encoder :D
Did you by any chance check if it performs similarly with the datetime attribute encoder?

docs/userguide/hyperparameter_optimization.md Outdated Show resolved Hide resolved
docs/userguide/hyperparameter_optimization.md Outdated Show resolved Hide resolved
docs/userguide/hyperparameter_optimization.md Outdated Show resolved Hide resolved
docs/userguide/hyperparameter_optimization.md Outdated Show resolved Hide resolved
docs/userguide/hyperparameter_optimization.md Outdated Show resolved Hide resolved
docs/userguide/hyperparameter_optimization.md Outdated Show resolved Hide resolved
docs/userguide/hyperparameter_optimization.md Show resolved Hide resolved
docs/userguide/hyperparameter_optimization.md Outdated Show resolved Hide resolved
docs/userguide/hyperparameter_optimization.md Show resolved Hide resolved
@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

dennisbader commented on 2022-09-25T13:50:21Z
----------------------------------------------------------------

This is a quite demanding requirements,

-> This is a quite demanding task,


@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

dennisbader commented on 2022-09-25T13:50:22Z
----------------------------------------------------------------

isort:

%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt
import optuna
import random
import torch
from optuna.integration import PyTorchLightningPruningCallback
from optuna.visualization import (
plot_contour,
plot_optimization_history,
plot_param_importances,
)
from pytorch_lightning.callbacks import Callback, EarlyStopping
from sklearn.preprocessing import MaxAbsScaler
from tqdm.notebook import tqdm

from darts.dataprocessing.transformers import Scaler
from darts.datasets import ElectricityDataset
from darts.metrics import smape
from darts.models import TCNModel, LinearRegressionModel
from darts.utils.likelihood_models import GaussianLikelihood



@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

dennisbader commented on 2022-09-25T13:50:22Z
----------------------------------------------------------------

it consists in using these hyperparameters to build a model

-> it consists of using these hyperparameters to build a model


@hrzn
Copy link
Contributor Author

hrzn commented Sep 27, 2022

Really cool stuff, thanks @hrzn ! Just added a few minor suggestions. P.s. I wonder why TCNModel performs worse with the dayofweek cyclic encoder :D Did you by any chance check if it performs similarly with the datetime attribute encoder?

Unfortunately I didn't experiment much with it. It's possible that this final config is still somewhat unlucky and using the dayofweek could still help a bit... Would be nice to try it out :)

hrzn and others added 9 commits September 27, 2022 17:01
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
@hrzn hrzn merged commit 2d0a035 into master Sep 28, 2022
@madtoinou madtoinou deleted the feat/hyperparameter-opt-guide branch July 5, 2023 21:55
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.

None yet

3 participants