Sklearn MLP Neural Network icon

Sklearn MLP Neural Network

Multi-layer Perceptron neural network using scikit-learn

Actions2

Train

AI-generated

Summary

Train a scikit-learn MLP neural network using specified features and target.

Inputs

  • modelType (required) — Type of model to train: 'Classifier' (MLPClassifier) or 'Regressor' (MLPRegressor)
  • featureColumns (required) — Comma-separated list of feature column names
  • targetColumn (required) — Name of the target column
  • hiddenLayerSizes — Comma-separated list of neurons per hidden layer
  • activation — Activation function for hidden layers
  • solver — Optimization algorithm
  • learningRateInit — Initial learning rate
  • maxIter — Maximum number of iterations
  • randomState — Random seed for reproducibility
  • pythonPath — Path to Python executable with scikit-learn installed

Output shape

a single JSON record

Includes model_pickle (base64‑encoded pickled model), model_type, score, n_layers, n_iterations, final_loss, hidden_layer_sizes, activation, feature_columns; classes appears only for classifiers.

Examples

Example 1: Train a classifier on an Iris dataset

modelType=Classifier, featureColumns=sepal_length,sepal_width,petal_length,petal_width, targetColumn=species, hiddenLayerSizes=100,50, activation=relu, solver=adam

Example 2: Train a regressor on housing prices

modelType=Regressor, featureColumns=area,rooms,floors, targetColumn=price, hiddenLayerSizes=200,100, activation=tanh, solver=lbfgs

Example 3: Quick demo with synthetic data

modelType=Classifier, featureColumns=x1,x2, targetColumn=label, hiddenLayerSizes=50, activation=logistic, solver=sgd

Discussion