You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[major] lagged regressor with interaction modeling (shared NN) (#903)
* initial version of model attribution
* consider quentiles in model interpretation
* simplified captum integration
* remove captum import error
* adressed pr comments
* initial shared covar net
* support model weights for shared covar net
* simplified covar net definition
* docs: added docstring to covar weights function
* reversed change on test file
* refactored compute components in shared covar net
* simplified weight calculation if shalllow covar net
* added attribution-based component forecasting
* refactored the compute components method
* updated notebook with shared regressor net
* support custom calculation of model attributions
* isort + flake8
* removed todos
* removed todos
* fixing computing components
* refactored storage of covar_weights
* added docs
* fixed pytests
* added alternative attribution method
* removed alternative attribution method
* reduce pandas warning
* Update plot_model_parameters_matplotlib.py
* log scale on metrics plots
* log scale on metrics plots
* covar_net and ar_net initialised through networks arrays
* covar_net and ar_net initialised through networks arrays
* (ar_net_layers_array, covar_net_layers_array) renamed to (ar_layers, lagged_reg_layers )
* documentation updated
* Tutorials updated
* Minor apadtions: Docstr and Typing
---------
Co-authored-by: alfonsogarciadecorral <alfonso.garcia.decorral@gmail.com>
Co-authored-by: Oskar Triebe <ourownstory@users.noreply.github.com>
Co-authored-by: julioare94 <julio@arend.mobi>
Copy file name to clipboardExpand all lines: docs/source/guides/hyperparameter-selection.md
+7-12Lines changed: 7 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -31,17 +31,12 @@ The default loss function is the 'Huber' loss, which is considered to be robust
31
31
However, you are free to choose the standard `MSE` or any other PyTorch `torch.nn.modules.loss` loss function.
32
32
33
33
## Increasing Depth of the Model
34
-
`num_hidden_layers` defines the number of hidden layers of the FFNNs used in the overall model. This includes the
35
-
AR-Net and the FFNN of the lagged regressors. The default is 0, meaning that the FFNNs will have only one final layer
36
-
of size `n_forecasts`. Adding more layers results in increased complexity and also increased computational time, consequently.
37
-
However, the added number of hidden layers can help build more complex relationships especially useful for the lagged
38
-
regressors. To tradeoff between the computational complexity and the improved accuracy the `num_hidden_layers` is recommended
39
-
to be set in between 1-2. Nevertheless, in most cases a good enough performance can be achieved by having no hidden layers at all.
40
-
41
-
`d_hidden` is the number of units in the hidden layers. This is only considered if `num_hidden_layers` is specified,
42
-
otherwise ignored. The default value for `d_hidden` if not specified is (`n_lags` + `n_forecasts`). If tuned manually, the recommended
43
-
practice is to set a value in between `n_lags` and `n_forecasts` for `d_hidden`. It is also important to note that with the current
44
-
implementation, NeuralProphet sets the same `d_hidden` for the all the hidden layers.
34
+
`ar_layers` defines the number of hidden layers and their sizes for the AR-Net in the overall model. It is an array where each element is the size of the corresponding hidden layer. The default is an empty array, meaning that the AR-Net will have only one final layer of size `n_forecasts`. Adding more layers results in increased complexity and also increased computational time, consequently. However, the added number of hidden layers can help build more complex relationships. To tradeoff between the computational complexity and the improved accuracy, the `ar_layers` is recommended to be set as an array with 1-2 elements. Nevertheless, in most cases, a good enough performance can be achieved by having no hidden layers at all.
35
+
36
+
`lagged_reg_layers` defines the number of hidden layers and their sizes for the lagged regressors' FFNN in the overall model. It is an array where each element is the size of the corresponding hidden layer. The default is an empty array, meaning that the FFNN of the lagged regressors will have only one final layer of size `n_forecasts`. Adding more layers results in increased complexity and also increased computational time, consequently. However, the added number of hidden layers can help build more complex relationships, especially useful for the lagged regressors. To tradeoff between the computational complexity and the improved accuracy, the `lagged_reg_layers` is recommended to be set as an array with 1-2 elements. Nevertheless, in most cases, a good enough performance can be achieved by having no hidden layers at all.
37
+
38
+
Please note that the previous `num_hidden_layers` and `d_hidden` arguments are now deprecated. The ar_net and covar_net architecture configuration is now input through `ar_layers` and `lagged_reg_layers`. If tuned manually, the recommended practice is to set values in between `n_lags` and `n_forecasts` for the sizes of the hidden layers. It is also important to note that with the current implementation, NeuralProphet allows you to specify different sizes for the hidden layers in both ar_net and covar_net.
39
+
45
40
46
41
## Data Preprocessing Related Parameters
47
42
@@ -83,7 +78,7 @@ distorted by such components, they can explicitly turn them off by setting the r
83
78
`yearly_seasonality`, `weekly_seasonality` and `daily_seasonality` can also be set to number of Fourier terms of the respective seasonalities.
84
79
The defaults are 6 for yearly, 4 for weekly and 6 for daily. Users can set this to any number they want. If the number of terms is 6 for yearly, that
85
80
effectively makes the total number of Fourier terms for the yearly seasonality 12 (6*2), to accommodate both sine and cosine terms.
86
-
Increasing the number of Fourier terms can make the model capable of capturing quite complex seasonal patterns. However, similar to the `num_hidden_layers`,
81
+
Increasing the number of Fourier terms can make the model capable of capturing quite complex seasonal patterns. However, similar to the `ar_layers`,
87
82
this too results in added model complexity. Users can get some insights about the optimal number of Fourier terms by looking at the final component
88
83
plots. The default `seasonality_mode` is additive. This means that no heteroscedasticity is expected in the series in terms of the seasonality.
89
84
However, if the series contains clear variance, where the seasonal fluctuations become larger proportional to the trend, the `seasonality_mode`
0 commit comments