Sklearn Ridge/Lasso icon

Sklearn Ridge/Lasso

Ridge (L2) and Lasso (L1) regularized regression using scikit-learn

Actions2

Predict

AI-generated

Summary

Predicts target values using a previously trained Ridge or Lasso model.

Inputs

  • modelType — Choice of regression model: Ridge (L2) or Lasso (L1). Defaults to Ridge.
  • modelData (required) — JSON string containing the pickled model trained offline.
  • predictFeatureColumns (required) — Comma-separated list of feature column names to use for prediction.
  • pythonPath — Path to the Python executable that has scikit-learn installed (default: python3).

Output shape

a list of workflow items, each appended with a 'prediction' field containing the model's output values

If the model cannot be decoded or a feature is missing, an error is thrown unless continueOnFail is enabled, in which case an error object is emitted.

Examples

Example 1: Apply a previously trained Ridge model to new data to forecast sales.

modelType=Ridge, modelData={"pickled_model":...}, predictFeatureColumns="advertising,seasonality", pythonPath=python3

Example 2: Use a Lasso model to predict house prices based on selected features.

modelType=Lasso, modelData={"model_pickle":"..."}, predictFeatureColumns="sqft,bedrooms,location", pythonPath="/usr/bin/python3.9"

Discussion