{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.rtemis.org/hyperparameters/bart/v1/schema.json",
  "title": "rtemis BARTHyperparameters",
  "description": "Bayesian Additive Regression Trees (stochtree). See `setup_BART`.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "num_trees": {
      "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 trees in the mean forest.",
      "x-rtemis": {
        "type": "integer",
        "tunable": true
      }
    },
    "alpha": {
      "oneOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "number",
                "exclusiveMinimum": 0,
                "exclusiveMaximum": 1
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Base of the tree split prior alpha * (1 + depth)^-beta.",
      "x-rtemis": {
        "type": "number",
        "tunable": true
      }
    },
    "beta": {
      "oneOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "number",
                "minimum": 0
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Depth penalty exponent of the tree split prior alpha * (1 + depth)^-beta.",
      "x-rtemis": {
        "type": "number",
        "tunable": true
      }
    },
    "min_samples_leaf": {
      "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": "Minimum number of training cases in a leaf. Cannot exceed the number of cases in the training data.",
      "x-rtemis": {
        "type": "integer",
        "tunable": true,
        "data_bound": "n_cases"
      }
    },
    "max_depth": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "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": "Maximum depth of any tree. NULL imposes no limit.",
      "x-rtemis": {
        "type": "integer",
        "tunable": true
      }
    },
    "num_features_subsample": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "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 features subsampled when growing each tree. NULL uses every feature. Cannot exceed the number of features in the training data.",
      "x-rtemis": {
        "type": "integer",
        "tunable": true,
        "data_bound": "n_features"
      }
    },
    "variance_forest_num_trees": {
      "oneOf": [
        {
          "type": "integer",
          "minimum": 0
        },
        {
          "type": "object",
          "properties": {
            "candidates": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0
              },
              "minItems": 2,
              "description": "Values to tune over; the tuner selects one."
            }
          },
          "required": ["candidates"],
          "additionalProperties": false
        }
      ],
      "description": "Number of trees in the conditional variance forest. 0 fits a homoskedastic model.",
      "x-rtemis": {
        "type": "integer",
        "tunable": true
      }
    },
    "num_gfr": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of grow-from-root warm-start iterations.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "num_burnin": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of burn-in MCMC iterations.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "num_mcmc": {
      "type": "integer",
      "minimum": 1,
      "description": "Number of retained MCMC iterations per chain.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "num_chains": {
      "type": "integer",
      "minimum": 1,
      "description": "Number of independent MCMC chains. Cannot exceed num_gfr unless num_gfr is 0.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "keep_every": {
      "type": "integer",
      "minimum": 1,
      "description": "Thinning interval: retain one MCMC sample in every keep_every.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "cutpoint_grid_size": {
      "type": "integer",
      "minimum": 1,
      "description": "Maximum number of candidate cutpoints considered by the grow-from-root algorithm.",
      "x-rtemis": {
        "type": "integer"
      }
    },
    "standardize": {
      "type": "boolean",
      "description": "Center and scale the outcome before sampling.",
      "x-rtemis": {
        "type": "boolean"
      }
    },
    "link": {
      "type": "string",
      "enum": ["probit", "cloglog"],
      "description": "Link function of the binary outcome model (classification only). \"cloglog\" cannot be combined with case weights.",
      "x-rtemis": {
        "type": "string"
      }
    },
    "seed": {
      "type": ["integer", "null"],
      "description": "Random seed for the sampler. NULL leaves the sampler seeded by the system.",
      "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
      }
    }
  }
}
