{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.rtemis.org/hyperparameters/hal/v1/schema.json",
  "title": "rtemis HALHyperparameters",
  "description": "Highly Adaptive Lasso (hal9001). See `setup_HAL`.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "max_degree": {
      "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": "Highest order of interaction among features that a basis function may represent. Cannot exceed the number of features in the training data.",
      "x-rtemis": {
        "type": "integer",
        "tunable": true,
        "data_bound": "n_features"
      }
    },
    "smoothness_orders": {
      "oneOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Smoothness of the basis functions: 0 fits zero-order indicators, 1 piecewise linear splines, higher values higher-order splines.",
      "x-rtemis": {
        "type": "integer",
        "tunable": true
      }
    },
    "num_knots": {
      "type": ["array", "null"],
      "items": {
        "type": "integer",
        "minimum": 1
      },
      "minItems": 1,
      "description": "Number of knots per interaction degree, one value per degree, non-increasing. NULL generates them from max_degree and smoothness_orders.",
      "x-rtemis": {
        "type": "integer",
        "container": "array"
      }
    },
    "reduce_basis": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "number",
          "maximum": 1,
          "exclusiveMinimum": 0
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "number",
                "maximum": 1,
                "exclusiveMinimum": 0
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Minimum proportion of cases a basis function must be non-zero in to be kept. NULL uses the backend default of 1/sqrt(n). Applies only when smoothness_orders is 0.",
      "x-rtemis": {
        "type": "number",
        "tunable": true,
        "applies_when": {
          "smoothness_orders": 0
        }
      }
    },
    "max_basis": {
      "type": "integer",
      "minimum": 1,
      "description": "Largest projected basis-function count that will be fit. Training aborts above it rather than enumerating a basis that will not finish.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "cv_select": {
      "const": true,
      "description": "Select lambda by cross-validation inside the fit; determined by the class.",
      "x-rtemis": {
        "type": "boolean",
        "role": "constant"
      }
    },
    "use_min": {
      "type": "boolean",
      "description": "Select lambda.min from the internal cross-validation. FALSE selects the more heavily penalized lambda.1se.",
      "x-rtemis": {
        "type": "boolean"
      }
    },
    "nfolds": {
      "type": "integer",
      "minimum": 3,
      "description": "Number of folds of the internal cross-validation that selects lambda.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "seed": {
      "type": ["integer", "null"],
      "description": "Random seed for the internal cross-validation's fold assignment. NULL leaves it drawn from the ambient RNG.",
      "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
      }
    }
  }
}
