{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.rtemis.org/resampler/stratboot/v1/schema.json",
  "title": "rtemis StratBootConfig",
  "description": "Stratified bootstrap. See setup_Resampler.",
  "type": "object",
  "properties": {
    "stratify_var": {
      "type": ["string", "null"],
      "default": null,
      "description": "Name of the variable to stratify by."
    },
    "train_p": {
      "type": "number",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 1,
      "default": 0.75,
      "description": "Training set fraction."
    },
    "strat_n_bins": {
      "type": "integer",
      "minimum": 1,
      "default": 4,
      "description": "Number of bins to stratify a continuous variable into."
    },
    "target_length": {
      "type": ["integer", "null"],
      "minimum": 1,
      "default": null,
      "description": "Target length for stratified bootstraps."
    },
    "seed": {
      "type": ["integer", "null"],
      "minimum": 0,
      "default": null,
      "description": "Random seed."
    },
    "id_strat": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "type": ["integer", "string"]
          },
          "minItems": 1
        }
      ],
      "$comment": "Data-dependent: per-case grouping IDs, length = number of cases; cases sharing an ID are kept in the same resample.",
      "description": "Optional vector of case IDs (e.g. subject IDs) to keep together when resampling. null = ordinary resampling."
    }
  }
}
