mlp – Multi-layer perceptron (sklearn).#
Back to family axis | Back to L4 | Browse all options
Operational op under axis
family, sub-layerL4_A_model_selection, layerl4. Standalone callable:mf.functions.mlp_fit.
Function signature#
mf.functions.mlp_fit(
X: np.ndarray | pd.DataFrame,
y: np.ndarray | pd.Series,
) -> MLPFitResult
Parameters#
name |
type |
default |
constraint |
description |
|---|---|---|---|---|
|
`np.ndarray |
pd.DataFrame` |
— |
— |
|
`np.ndarray |
pd.Series` |
— |
— |
Returns#
MLPFitResult — frozen dataclass with fit results.
Attribute |
Type |
Description |
|---|---|---|
|
|
Total number of trainable parameters (weights + biases). |
|
|
Number of input features seen during fit. |
|
|
Tuple of hidden layer widths, e.g. (32, 16). |
|
|
Number of optimiser iterations completed. |
|
|
Training MSE at the end of fitting. |
|
|
Predictions for new data X, shape (n_samples,). |
|
|
Arch metadata table: model_type, hidden_layer_sizes, n_features, n_params, epochs_used, final_loss. |
Behavior#
Feed-forward NN with ReLU activations. params.hidden_layer_sizes controls the architecture.
v0.9 sub-axes (apply equally to mlp / lstm / gru / transformer):
params.architecture– network topology.standard(default) is the standard feed-forward / sequence variant.hemisphere(future) implements Coulombe / Frenette / Klieber (2025 JAE) HNN with separate mean / variance hemispheres joined by a constraint loss.params.loss– objective.mse(default),quantile(operational via forecast_object=quantile),volatility_emphasis(future, HNN constraint loss).
When to use
Non-linear regression baselines; ablations against deep NN.
In recipe context#
Set params.family = "mlp" in the relevant layer to activate this op within a recipe:
# Layer L4 recipe fragment
params:
family: mlp
References#
macroforecast design Part 2, L4: ‘forecasting model is the layer where every authoring iteration ends – pick family, tune, repeat.’