{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.rtemis.org/hyperparameters/modalitystacking/v1/schema.json",
  "title": "rtemis ModalityStackingHyperparameters",
  "description": "ModalityStacking: stacked ensemble with one learner per feature group. See `setup_ModalityStacking`.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "base_learners": {
      "type": "array",
      "items": {
        "$ref": "https://schema.rtemis.org/hyperparameters/v1/schema.json"
      }
    },
    "inner_resampling_config": {
      "$ref": "https://schema.rtemis.org/resampler/v1/schema.json"
    },
    "expand_search_spaces": {
      "type": "boolean",
      "description": "Expand a base learner's search space into one library entry per grid combination, rather than tuning it by inner resampling.",
      "x-rtemis": {
        "type": "boolean"
      }
    },
    "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
      }
    },
    "meta_learner": {
      "$ref": "https://schema.rtemis.org/hyperparameters/v1/schema.json"
    },
    "discrete": {
      "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": "Keep the single library entry with the lowest cross-validated risk rather than the weighted combination.",
      "x-rtemis": {
        "type": "boolean",
        "tunable": true
      }
    },
    "feature_groups": {
      "type": ["object", "null"],
      "additionalProperties": {
        "type": ["array", "null"],
        "items": {
          "type": "string"
        },
        "minItems": 1,
        "x-rtemis": {
          "type": "string",
          "container": "array"
        }
      },
      "description": "Features each base learner sees, keyed by base learner name. Values must name training features.",
      "x-rtemis": {
        "type": "string",
        "container": "map",
        "data_bound": "feature_names",
        "data_dependent": true
      },
      "$comment": "Data-dependent: its values name training features, so it cannot be filled in without the data."
    }
  }
}
