{
  "slug": "regression-model-trainer",
  "name": "gizza-ai/regression-model-trainer",
  "version": "0.1.0",
  "title": "Regression model trainer — linear, ridge & random forest — gizza.ai",
  "description": "Fit linear, ridge, or bounded random-forest regression from a pasted numeric table and report R², RMSE, MAE, coefficients, or feature importance.",
  "tags": [
    "regression",
    "linear regression",
    "ridge regression",
    "random forest",
    "machine learning",
    "csv"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/regression-model-trainer/",
    "markdown": "https://gizza.ai/tools/regression-model-trainer/index.md",
    "descriptor": "https://gizza.ai/tools/regression-model-trainer/tool.json",
    "deep_link_example": "https://gizza.ai/tools/regression-model-trainer/?data=x%2Cy%0A1%2C3%0A2%2C5%0A3%2C7%0A4%2C9&target=last&features=x1%2Cx2&model=linear&alpha=1&standardize=true&trees=100&max_depth=8&test_split=0&cv_folds=0&seed=42&header=auto&decimals=4&format=text"
  },
  "cli": "gizza tool regression-model-trainer \"x,y\n1,3\n2,5\n3,7\n4,9\"",
  "tool": {
    "description": "Fit a regression model to a pasted numeric table, predict a target column, and report R², RMSE, MAE, coefficients or feature importance, optional test split, and optional cross-validation. Runs locally in pure Rust/WASM.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "alpha": {
          "default": 1.0,
          "description": "Ridge L2 penalty strength. Used only when model is ridge.",
          "maximum": 1000000000,
          "minimum": 0,
          "type": "number"
        },
        "cv_folds": {
          "default": 0,
          "description": "Cross-validation folds: 0 disables CV, otherwise use 2 through 10.",
          "maximum": 10,
          "minimum": 0,
          "type": "integer"
        },
        "data": {
          "description": "CSV, TSV, semicolon, pipe, or whitespace-delimited numeric table. Use one row per observation; the first row may be a header.",
          "type": "string"
        },
        "decimals": {
          "default": 4,
          "description": "Decimal places for text and CSV output.",
          "maximum": 12,
          "minimum": 0,
          "type": "integer"
        },
        "features": {
          "default": "",
          "description": "Optional comma-separated feature columns by name or 1-based index. Leave empty to use every non-target column.",
          "type": "string"
        },
        "format": {
          "default": "text",
          "description": "Output format.",
          "enum": [
            "text",
            "json",
            "csv"
          ],
          "type": "string"
        },
        "header": {
          "default": "auto",
          "description": "Whether the first row contains column names.",
          "enum": [
            "auto",
            "yes",
            "no"
          ],
          "type": "string"
        },
        "max_depth": {
          "default": 8,
          "description": "Maximum depth for each random_forest tree.",
          "maximum": 20,
          "minimum": 1,
          "type": "integer"
        },
        "model": {
          "default": "linear",
          "description": "Regression algorithm: ordinary least squares, L2-regularized ridge, or a deterministic small random forest.",
          "enum": [
            "linear",
            "ridge",
            "random_forest"
          ],
          "type": "string"
        },
        "seed": {
          "default": 42,
          "description": "Deterministic seed for splits, folds, and random forest sampling.",
          "minimum": 0,
          "type": "integer"
        },
        "standardize": {
          "default": true,
          "description": "Standardize predictors before applying ridge regularization, then report coefficients back in original units.",
          "type": "boolean"
        },
        "target": {
          "default": "last",
          "description": "Target column to predict: last, first, a 1-based index, or a header name.",
          "type": "string"
        },
        "test_split": {
          "default": 0.0,
          "description": "Fraction of rows to hold out for a deterministic test set, from 0 to 0.5.",
          "maximum": 0.5,
          "minimum": 0,
          "type": "number"
        },
        "trees": {
          "default": 100,
          "description": "Number of trees for random_forest.",
          "maximum": 300,
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    }
  }
}