{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.rtemis.org/hyperparameters/spls/v1/schema.json",
  "title": "rtemis SPLSHyperparameters",
  "description": "Sparse Partial Least Squares. See `setup_SPLS`.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "k": {
      "oneOf": [
        {
          "type": "integer",
          "minimum": 1
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 1
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Number of latent components. Cannot exceed the number of features in the training data.",
      "x-rtemis": {
        "type": "integer",
        "tunable": true,
        "data_bound": "n_features"
      }
    },
    "eta": {
      "oneOf": [
        {
          "type": "number",
          "minimum": 0,
          "exclusiveMaximum": 1
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "number",
                "minimum": 0,
                "exclusiveMaximum": 1
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Sparsity threshold: higher values select fewer features.",
      "x-rtemis": {
        "type": "number",
        "tunable": true
      }
    },
    "kappa": {
      "oneOf": [
        {
          "type": "number",
          "minimum": 0,
          "maximum": 0.5
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "number",
                "minimum": 0,
                "maximum": 0.5
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Concavity of the surrogate direction vector problem. Used with a multivariate coded outcome, i.e. multiclass classification.",
      "x-rtemis": {
        "type": "number",
        "tunable": true
      }
    },
    "select": {
      "type": "string",
      "enum": ["pls2", "simpls"],
      "description": "Feature selection algorithm (regression only).",
      "x-rtemis": {
        "type": "string"
      }
    },
    "fit": {
      "type": "string",
      "enum": ["kernelpls", "widekernelpls", "simpls", "oscorespls"],
      "description": "PLS algorithm used for model fitting (regression only).",
      "x-rtemis": {
        "type": "string"
      }
    },
    "classifier": {
      "type": "string",
      "enum": ["lda", "logistic"],
      "description": "Classifier fit on the latent components (classification only).",
      "x-rtemis": {
        "type": "string"
      }
    },
    "scale_x": {
      "type": "boolean",
      "description": "Scale features to unit variance.",
      "x-rtemis": {
        "type": "boolean"
      }
    },
    "scale_y": {
      "type": "boolean",
      "description": "Scale the outcome to unit variance (regression only).",
      "x-rtemis": {
        "type": "boolean"
      }
    },
    "eps": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Convergence tolerance (regression only).",
      "x-rtemis": {
        "type": "number"
      }
    },
    "maxstep": {
      "type": "integer",
      "minimum": 1,
      "description": "Maximum number of iterations per component (regression only).",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "ifw": {
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "boolean"
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Inverse Frequency Weighting in classification.",
      "x-rtemis": {
        "type": "boolean",
        "tunable": true
      }
    }
  }
}
