zoo
¶
Classes:
| Name | Description |
|---|---|
GRUForecaster |
Autoregressive forecaster backed by |
LSTMForecaster |
Autoregressive forecaster backed by |
LinearForecaster |
Autoregressive linear forecaster with optional exogenous features. |
LiquidForecaster |
Autoregressive forecaster backed by closed-form liquid recurrent cells. |
MLPForecaster |
Autoregressive multi-layer perceptron forecaster. |
NBEATSForecaster |
Compact N-BEATS-style residual MLP forecaster for online point forecasts. |
RNNForecaster |
Autoregressive forecaster backed by |
GRUForecaster
¶
GRUForecaster(
n_features: int = 0,
window_size: int = 10,
hidden_size: int = 16,
num_layers: int = 1,
dropout: float = 0.0,
loss_fn: Union[str, Callable] = "mse",
optimizer_fn: Union[str, Type[Optimizer]] = "adam",
lr: float = 0.001,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
gradient_clip_value: float | None = 1.0,
**kwargs
)
Bases: DeepForecaster
Autoregressive forecaster backed by torch.nn.GRU.
Methods:
| Name | Description |
|---|---|
clone |
Return a fresh estimator instance with (optionally) copied state. |
draw |
Render a (partial) computational graph of the wrapped model. |
forecast |
Forecast |
learn_one |
Update the model with one target and optional exogenous features. |
load |
Load a previously saved estimator. |
save |
Persist the estimator (architecture, weights, optimiser & runtime state). |
Source code in deep_river/forecasting/zoo.py
clone
¶
Return a fresh estimator instance with (optionally) copied state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_params
|
dict | None
|
Parameter overrides for the cloned instance. |
None
|
include_attributes
|
bool
|
If True, runtime state (observed features, buffers) is also copied. |
False
|
copy_weights
|
bool
|
If True, model weights are copied (otherwise the module is re‑initialised). |
False
|
Source code in deep_river/base.py
draw
¶
Render a (partial) computational graph of the wrapped model.
Imports graphviz and torchviz lazily. Raises an informative
ImportError if the optional dependencies are not installed.
Source code in deep_river/base.py
forecast
¶
Forecast horizon steps ahead using autoregressive rollouts.
Source code in deep_river/forecasting/forecaster.py
learn_one
¶
Update the model with one target and optional exogenous features.
Source code in deep_river/forecasting/forecaster.py
load
classmethod
¶
Load a previously saved estimator.
The method reconstructs the estimator class, its wrapped module, optimiser state and runtime information (feature names, buffers, etc.).
Source code in deep_river/base.py
save
¶
Persist the estimator (architecture, weights, optimiser & runtime state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Destination file. Parent directories are created automatically. |
required |
Source code in deep_river/base.py
LSTMForecaster
¶
LSTMForecaster(
n_features: int = 0,
window_size: int = 10,
hidden_size: int = 16,
num_layers: int = 1,
dropout: float = 0.0,
loss_fn: Union[str, Callable] = "mse",
optimizer_fn: Union[str, Type[Optimizer]] = "adam",
lr: float = 0.001,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
gradient_clip_value: float | None = 1.0,
**kwargs
)
Bases: DeepForecaster
Autoregressive forecaster backed by torch.nn.LSTM.
Methods:
| Name | Description |
|---|---|
clone |
Return a fresh estimator instance with (optionally) copied state. |
draw |
Render a (partial) computational graph of the wrapped model. |
forecast |
Forecast |
learn_one |
Update the model with one target and optional exogenous features. |
load |
Load a previously saved estimator. |
save |
Persist the estimator (architecture, weights, optimiser & runtime state). |
Source code in deep_river/forecasting/zoo.py
clone
¶
Return a fresh estimator instance with (optionally) copied state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_params
|
dict | None
|
Parameter overrides for the cloned instance. |
None
|
include_attributes
|
bool
|
If True, runtime state (observed features, buffers) is also copied. |
False
|
copy_weights
|
bool
|
If True, model weights are copied (otherwise the module is re‑initialised). |
False
|
Source code in deep_river/base.py
draw
¶
Render a (partial) computational graph of the wrapped model.
Imports graphviz and torchviz lazily. Raises an informative
ImportError if the optional dependencies are not installed.
Source code in deep_river/base.py
forecast
¶
Forecast horizon steps ahead using autoregressive rollouts.
Source code in deep_river/forecasting/forecaster.py
learn_one
¶
Update the model with one target and optional exogenous features.
Source code in deep_river/forecasting/forecaster.py
load
classmethod
¶
Load a previously saved estimator.
The method reconstructs the estimator class, its wrapped module, optimiser state and runtime information (feature names, buffers, etc.).
Source code in deep_river/base.py
save
¶
Persist the estimator (architecture, weights, optimiser & runtime state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Destination file. Parent directories are created automatically. |
required |
Source code in deep_river/base.py
LinearForecaster
¶
LinearForecaster(
n_features: int = 0,
window_size: int = 10,
loss_fn: Union[str, Callable] = "mse",
optimizer_fn: Union[str, Type[Optimizer]] = "sgd",
lr: float = 0.001,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
gradient_clip_value: float | None = 1.0,
**kwargs
)
Bases: DeepForecaster
Autoregressive linear forecaster with optional exogenous features.
Methods:
| Name | Description |
|---|---|
clone |
Return a fresh estimator instance with (optionally) copied state. |
draw |
Render a (partial) computational graph of the wrapped model. |
forecast |
Forecast |
learn_one |
Update the model with one target and optional exogenous features. |
load |
Load a previously saved estimator. |
save |
Persist the estimator (architecture, weights, optimiser & runtime state). |
Source code in deep_river/forecasting/zoo.py
clone
¶
Return a fresh estimator instance with (optionally) copied state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_params
|
dict | None
|
Parameter overrides for the cloned instance. |
None
|
include_attributes
|
bool
|
If True, runtime state (observed features, buffers) is also copied. |
False
|
copy_weights
|
bool
|
If True, model weights are copied (otherwise the module is re‑initialised). |
False
|
Source code in deep_river/base.py
draw
¶
Render a (partial) computational graph of the wrapped model.
Imports graphviz and torchviz lazily. Raises an informative
ImportError if the optional dependencies are not installed.
Source code in deep_river/base.py
forecast
¶
Forecast horizon steps ahead using autoregressive rollouts.
Source code in deep_river/forecasting/forecaster.py
learn_one
¶
Update the model with one target and optional exogenous features.
Source code in deep_river/forecasting/forecaster.py
load
classmethod
¶
Load a previously saved estimator.
The method reconstructs the estimator class, its wrapped module, optimiser state and runtime information (feature names, buffers, etc.).
Source code in deep_river/base.py
save
¶
Persist the estimator (architecture, weights, optimiser & runtime state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Destination file. Parent directories are created automatically. |
required |
Source code in deep_river/base.py
LiquidForecaster
¶
LiquidForecaster(
n_features: int = 0,
window_size: int = 10,
hidden_size: int = 16,
num_layers: int = 1,
dropout: float = 0.0,
time_delta: float = 1.0,
loss_fn: Union[str, Callable] = "mse",
optimizer_fn: Union[str, Type[Optimizer]] = "adam",
lr: float = 0.001,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
gradient_clip_value: float | None = 1.0,
**kwargs
)
Bases: DeepForecaster
Autoregressive forecaster backed by closed-form liquid recurrent cells.
The recurrent state follows a fixed-step liquid update where each hidden unit
learns a positive time constant. time_delta is constant across all steps,
matching regularly sampled time series.
Methods:
| Name | Description |
|---|---|
clone |
Return a fresh estimator instance with (optionally) copied state. |
draw |
Render a (partial) computational graph of the wrapped model. |
forecast |
Forecast |
learn_one |
Update the model with one target and optional exogenous features. |
load |
Load a previously saved estimator. |
save |
Persist the estimator (architecture, weights, optimiser & runtime state). |
Source code in deep_river/forecasting/zoo.py
clone
¶
Return a fresh estimator instance with (optionally) copied state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_params
|
dict | None
|
Parameter overrides for the cloned instance. |
None
|
include_attributes
|
bool
|
If True, runtime state (observed features, buffers) is also copied. |
False
|
copy_weights
|
bool
|
If True, model weights are copied (otherwise the module is re‑initialised). |
False
|
Source code in deep_river/base.py
draw
¶
Render a (partial) computational graph of the wrapped model.
Imports graphviz and torchviz lazily. Raises an informative
ImportError if the optional dependencies are not installed.
Source code in deep_river/base.py
forecast
¶
Forecast horizon steps ahead using autoregressive rollouts.
Source code in deep_river/forecasting/forecaster.py
learn_one
¶
Update the model with one target and optional exogenous features.
Source code in deep_river/forecasting/forecaster.py
load
classmethod
¶
Load a previously saved estimator.
The method reconstructs the estimator class, its wrapped module, optimiser state and runtime information (feature names, buffers, etc.).
Source code in deep_river/base.py
save
¶
Persist the estimator (architecture, weights, optimiser & runtime state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Destination file. Parent directories are created automatically. |
required |
Source code in deep_river/base.py
MLPForecaster
¶
MLPForecaster(
n_features: int = 0,
window_size: int = 10,
n_width: int = 16,
n_layers: int = 2,
loss_fn: Union[str, Callable] = "mse",
optimizer_fn: Union[str, Type[Optimizer]] = "adam",
lr: float = 0.001,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
gradient_clip_value: float | None = 1.0,
**kwargs
)
Bases: DeepForecaster
Autoregressive multi-layer perceptron forecaster.
Methods:
| Name | Description |
|---|---|
clone |
Return a fresh estimator instance with (optionally) copied state. |
draw |
Render a (partial) computational graph of the wrapped model. |
forecast |
Forecast |
learn_one |
Update the model with one target and optional exogenous features. |
load |
Load a previously saved estimator. |
save |
Persist the estimator (architecture, weights, optimiser & runtime state). |
Source code in deep_river/forecasting/zoo.py
clone
¶
Return a fresh estimator instance with (optionally) copied state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_params
|
dict | None
|
Parameter overrides for the cloned instance. |
None
|
include_attributes
|
bool
|
If True, runtime state (observed features, buffers) is also copied. |
False
|
copy_weights
|
bool
|
If True, model weights are copied (otherwise the module is re‑initialised). |
False
|
Source code in deep_river/base.py
draw
¶
Render a (partial) computational graph of the wrapped model.
Imports graphviz and torchviz lazily. Raises an informative
ImportError if the optional dependencies are not installed.
Source code in deep_river/base.py
forecast
¶
Forecast horizon steps ahead using autoregressive rollouts.
Source code in deep_river/forecasting/forecaster.py
learn_one
¶
Update the model with one target and optional exogenous features.
Source code in deep_river/forecasting/forecaster.py
load
classmethod
¶
Load a previously saved estimator.
The method reconstructs the estimator class, its wrapped module, optimiser state and runtime information (feature names, buffers, etc.).
Source code in deep_river/base.py
save
¶
Persist the estimator (architecture, weights, optimiser & runtime state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Destination file. Parent directories are created automatically. |
required |
Source code in deep_river/base.py
NBEATSForecaster
¶
NBEATSForecaster(
n_features: int = 0,
window_size: int = 10,
n_width: int = 32,
n_layers: int = 2,
n_blocks: int = 2,
loss_fn: Union[str, Callable] = "mse",
optimizer_fn: Union[str, Type[Optimizer]] = "adam",
lr: float = 0.001,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
gradient_clip_value: float | None = 1.0,
**kwargs
)
Bases: DeepForecaster
Compact N-BEATS-style residual MLP forecaster for online point forecasts.
Methods:
| Name | Description |
|---|---|
clone |
Return a fresh estimator instance with (optionally) copied state. |
draw |
Render a (partial) computational graph of the wrapped model. |
forecast |
Forecast |
learn_one |
Update the model with one target and optional exogenous features. |
load |
Load a previously saved estimator. |
save |
Persist the estimator (architecture, weights, optimiser & runtime state). |
Source code in deep_river/forecasting/zoo.py
clone
¶
Return a fresh estimator instance with (optionally) copied state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_params
|
dict | None
|
Parameter overrides for the cloned instance. |
None
|
include_attributes
|
bool
|
If True, runtime state (observed features, buffers) is also copied. |
False
|
copy_weights
|
bool
|
If True, model weights are copied (otherwise the module is re‑initialised). |
False
|
Source code in deep_river/base.py
draw
¶
Render a (partial) computational graph of the wrapped model.
Imports graphviz and torchviz lazily. Raises an informative
ImportError if the optional dependencies are not installed.
Source code in deep_river/base.py
forecast
¶
Forecast horizon steps ahead using autoregressive rollouts.
Source code in deep_river/forecasting/forecaster.py
learn_one
¶
Update the model with one target and optional exogenous features.
Source code in deep_river/forecasting/forecaster.py
load
classmethod
¶
Load a previously saved estimator.
The method reconstructs the estimator class, its wrapped module, optimiser state and runtime information (feature names, buffers, etc.).
Source code in deep_river/base.py
save
¶
Persist the estimator (architecture, weights, optimiser & runtime state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Destination file. Parent directories are created automatically. |
required |
Source code in deep_river/base.py
RNNForecaster
¶
RNNForecaster(
n_features: int = 0,
window_size: int = 10,
hidden_size: int = 16,
num_layers: int = 1,
nonlinearity: str = "tanh",
dropout: float = 0.0,
loss_fn: Union[str, Callable] = "mse",
optimizer_fn: Union[str, Type[Optimizer]] = "adam",
lr: float = 0.001,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
gradient_clip_value: float | None = 1.0,
**kwargs
)
Bases: DeepForecaster
Autoregressive forecaster backed by torch.nn.RNN.
Methods:
| Name | Description |
|---|---|
clone |
Return a fresh estimator instance with (optionally) copied state. |
draw |
Render a (partial) computational graph of the wrapped model. |
forecast |
Forecast |
learn_one |
Update the model with one target and optional exogenous features. |
load |
Load a previously saved estimator. |
save |
Persist the estimator (architecture, weights, optimiser & runtime state). |
Source code in deep_river/forecasting/zoo.py
clone
¶
Return a fresh estimator instance with (optionally) copied state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_params
|
dict | None
|
Parameter overrides for the cloned instance. |
None
|
include_attributes
|
bool
|
If True, runtime state (observed features, buffers) is also copied. |
False
|
copy_weights
|
bool
|
If True, model weights are copied (otherwise the module is re‑initialised). |
False
|
Source code in deep_river/base.py
draw
¶
Render a (partial) computational graph of the wrapped model.
Imports graphviz and torchviz lazily. Raises an informative
ImportError if the optional dependencies are not installed.
Source code in deep_river/base.py
forecast
¶
Forecast horizon steps ahead using autoregressive rollouts.
Source code in deep_river/forecasting/forecaster.py
learn_one
¶
Update the model with one target and optional exogenous features.
Source code in deep_river/forecasting/forecaster.py
load
classmethod
¶
Load a previously saved estimator.
The method reconstructs the estimator class, its wrapped module, optimiser state and runtime information (feature names, buffers, etc.).
Source code in deep_river/base.py
save
¶
Persist the estimator (architecture, weights, optimiser & runtime state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str | Path
|
Destination file. Parent directories are created automatically. |
required |