Skip to main content

MLPRegressor

#include <Skigen/NeuralNetwork>

template <typename Scalar = double>
class Skigen::MLPRegressor(hidden_layer_sizes={100}, activation=MLPActivation::ReLU, solver=MLPSolver::Adam, alpha=1e-4, learning_rate_init=1e-3, max_iter=200, tol=1e-4, batch_size=0, random_state=std::nullopt, beta_1=0.9, beta_2=0.999, epsilon=1e-8)

Multi-layer perceptron regressor with squared-error loss.

Mirrors sklearn.neural_network.MLPRegressor.

Architecture: an arbitrary stack of fully-connected hidden layers with the chosen activation, followed by a linear output layer. Trained by mini-batch SGD or Adam on the squared-error loss with L2 weight regularisation (alpha).



Attributes:

  • hidden_layer_sizes : const std::vector< int > &

  • activation : MLPActivation

  • solver : MLPSolver

  • n_iter_run : int

  • loss : Scalar

  • coefs : const std::vector< MatrixType > &

  • intercepts : const std::vector< VectorType > &

  • n_outputs : int


Methods

SKIGEN_PARAMS()


fit_multi(X, Y)

Fit on multiple target columns.


predict(X)


predict_multi(X)

Predict multiple targets (returns n_samples × n_targets matrix).


score(X, y)