def _validate_params()

in orbit/diagnostics/backtest.py [0:0]


    def _validate_params(self):
        if self.min_train_len is None and self.n_splits is None:
            raise BacktestException("min_train_len and n_splits cannot both be None...")

        if self.window_type not in [
            TimeSeriesSplitSchemeKeys.SPLIT_TYPE_EXPANDING.value,
            TimeSeriesSplitSchemeKeys.SPLIT_TYPE_ROLLING.value,
        ]:
            raise BacktestException("unknown window type...")

        # forecast length invalid
        if self.forecast_len <= 0:
            raise BacktestException("holdout period length must be positive...")

        # train + test length cannot be longer than df length
        if self.min_train_len + self.forecast_len > self._full_len:
            raise BacktestException(
                "required time span is more than the full data frame..."
            )

        if self.n_splits is not None and self.n_splits < 1:
            raise BacktestException("n_split must be a positive number")

        if self.date_col:
            if self.date_col not in self.df.columns:
                raise BacktestException("date_col not found in df provided.")