zoo
¶
Classes:
Name | Description |
---|---|
LSTMRegressorInitialized |
|
LinearRegressionInitialized |
Linear Regression model for regression. |
MultiLayerPerceptronInitialized |
Linear Regression model for regression. |
LSTMRegressorInitialized
¶
LSTMRegressorInitialized(
n_features: int = 10,
loss_fn: Union[
str, Callable
] = "binary_cross_entropy_with_logits",
optimizer_fn: Union[str, Type[Optimizer]] = "sgd",
lr: float = 0.001,
output_is_logit: bool = True,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
**kwargs
)
Bases: RollingRegressorInitialized
Methods:
Name | Description |
---|---|
learn_many |
Performs one step of training with the most recent training examples |
learn_one |
Performs one step of training with the most recent training examples |
predict_many |
Predict the probability of each label given the most recent examples |
predict_one |
Predict the probability of each label given the most recent examples |
Source code in deep_river/regression/zoo.py
learn_many
¶
Performs one step of training with the most recent training examples stored in the sliding window.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
DataFrame
|
Input examples. |
required |
y
|
Series
|
Target values. |
required |
Returns:
Type | Description |
---|---|
Self
|
The regressor itself. |
Source code in deep_river/regression/rolling_regressor.py
learn_one
¶
Performs one step of training with the most recent training examples stored in the sliding window.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
dict
|
Input example. |
required |
y
|
RegTarget
|
Target value. |
required |
Returns:
Type | Description |
---|---|
Self
|
The regressor itself. |
Source code in deep_river/regression/rolling_regressor.py
predict_many
¶
Predict the probability of each label given the most recent examples
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
DataFrame
|
|
required |
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame of probabilities for each label. |
Source code in deep_river/regression/rolling_regressor.py
predict_one
¶
Predict the probability of each label given the most recent examples stored in the sliding window.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
dict
|
Input example. |
required |
Returns:
Type | Description |
---|---|
Dict[ClfTarget, float]
|
Dictionary of probabilities for each label. |
Source code in deep_river/regression/rolling_regressor.py
LinearRegressionInitialized
¶
LinearRegressionInitialized(
n_features: int = 10,
loss_fn: Union[
str, Callable
] = "binary_cross_entropy_with_logits",
optimizer_fn: Union[str, Type[Optimizer]] = "sgd",
lr: float = 0.001,
output_is_logit: bool = True,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
**kwargs
)
Bases: RegressorInitialized
Linear Regression model for regression.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
loss_fn
|
str or Callable
|
Loss function to be used for training the wrapped model. |
'binary_cross_entropy_with_logits'
|
optimizer_fn
|
str or Callable
|
Optimizer to be used for training the wrapped model. |
'sgd'
|
lr
|
float
|
Learning rate of the optimizer. |
0.001
|
output_is_logit
|
bool
|
Whether the module produces logits as output. If true, either softmax or sigmoid is applied to the outputs when predicting. |
True
|
is_class_incremental
|
bool
|
Whether the classifier should adapt to the appearance of previously unobserved classes by adding an unit to the output layer of the network. |
required |
is_feature_incremental
|
bool
|
Whether the model should adapt to the appearance of previously features by adding units to the input layer of the network. |
False
|
device
|
str
|
Device to run the wrapped model on. Can be "cpu" or "cuda". |
'cpu'
|
seed
|
int
|
Random seed to be used for training the wrapped model. |
42
|
**kwargs
|
Parameters to be passed to the |
{}
|
Methods:
Name | Description |
---|---|
predict_many |
Predicts probabilities for multiple examples. |
predict_one |
Predicts the target value for a single example. |
Source code in deep_river/regression/zoo.py
predict_many
¶
Predicts probabilities for multiple examples.
Source code in deep_river/regression/regressor.py
predict_one
¶
Predicts the target value for a single example.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
dict
|
Input example. |
required |
Returns:
Type | Description |
---|---|
RegTarget
|
Predicted target value. |
Source code in deep_river/regression/regressor.py
MultiLayerPerceptronInitialized
¶
MultiLayerPerceptronInitialized(
n_features: int = 10,
n_width: int = 5,
n_layers: int = 5,
loss_fn: Union[
str, Callable
] = "binary_cross_entropy_with_logits",
optimizer_fn: Union[str, Type[Optimizer]] = "sgd",
lr: float = 0.001,
output_is_logit: bool = True,
is_feature_incremental: bool = False,
device: str = "cpu",
seed: int = 42,
**kwargs
)
Bases: RegressorInitialized
Linear Regression model for regression.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
loss_fn
|
str or Callable
|
Loss function to be used for training the wrapped model. |
'binary_cross_entropy_with_logits'
|
optimizer_fn
|
str or Callable
|
Optimizer to be used for training the wrapped model. |
'sgd'
|
lr
|
float
|
Learning rate of the optimizer. |
0.001
|
output_is_logit
|
bool
|
Whether the module produces logits as output. If true, either softmax or sigmoid is applied to the outputs when predicting. |
True
|
is_class_incremental
|
bool
|
Whether the classifier should adapt to the appearance of previously unobserved classes by adding an unit to the output layer of the network. |
required |
is_feature_incremental
|
bool
|
Whether the model should adapt to the appearance of previously features by adding units to the input layer of the network. |
False
|
device
|
str
|
Device to run the wrapped model on. Can be "cpu" or "cuda". |
'cpu'
|
seed
|
int
|
Random seed to be used for training the wrapped model. |
42
|
**kwargs
|
Parameters to be passed to the |
{}
|
Methods:
Name | Description |
---|---|
predict_many |
Predicts probabilities for multiple examples. |
predict_one |
Predicts the target value for a single example. |
Source code in deep_river/regression/zoo.py
predict_many
¶
Predicts probabilities for multiple examples.
Source code in deep_river/regression/regressor.py
predict_one
¶
Predicts the target value for a single example.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
dict
|
Input example. |
required |
Returns:
Type | Description |
---|---|
RegTarget
|
Predicted target value. |