Skip to content

rbv2_xgboost

class RBV2xgboostConfig
dataclass
#

Bases: RBV2Config

def validate() #

Validate this config.

Source code in src/mfpbench/yahpo/benchmarks/rbv2/rbv2_xgboost.py
@no_type_check
def validate(self) -> None:
    """Validate this config."""
    assert self.booster in ["gblinear", "gbtree", "dart"]
    assert 0.0009118819655545162 <= self.alpha <= 1096.6331584284585
    assert 0.0009118819655545162 <= self._lambda <= 1096.6331584284585
    assert 7 <= self.nrounds <= 2981
    assert 0.1 <= self.subsample <= 1.0

    if self.colsample_bylevel is not None:
        assert self.booster in ["dart", "gbtree"]
        assert 0.01 <= self.colsample_bylevel <= 1.0

    if self.colsample_bytree is not None:
        assert self.booster in ["dart", "gbtree"]
        assert 0.01 <= self.colsample_bytree <= 1.0

    if self.eta is not None:
        assert self.booster in ["dart", "gbtree"]
        assert 0.0009118819655545162 <= self.eta <= 1.0

    if self.gamma is not None:
        assert self.booster in ["dart", "gbtree"]
        assert 4.5399929762484854e-05 <= self.gamma <= 7.38905609893065

    if self.max_depth is not None:
        assert self.booster in ["dart", "gbtree"]
        assert 1 <= self.max_depth <= 15

    if self.min_child_weight is not None:
        assert self.booster in ["dart", "gbtree"]
        assert 2.718281828459045 <= self.min_child_weight <= 148.4131591025766

    if self.rate_drop is not None:
        assert self.booster in ["dart"]
        assert 0.0 <= self.rate_drop <= 1.0

    if self.skip_drop is not None:
        assert self.booster in ["dart"]
        assert 0.0 <= self.skip_drop <= 1.0

    assert self.num__impute__selected__cpo in [
        "impute.mean",
        "impute.median",
        "impute.hist",
    ]