def test_get_estimator_exceptions(self, caplog):
        """Check that all the corner-cases are properly covered by the method"""
        ts = TimeSeries.from_values(
            values=np.array([
                [0, 0, 0, 0, 1],
                [0, 0, 0, 0, 2],
            ]).T,
            columns=["a", "b"],
        )
        m = LinearRegressionModel(
            lags=2,
            output_chunk_length=2,
            random_state=1,
        )
        m.fit(ts["a"])
        # not wrapped in MultiOutputRegressor because of native multi-output support
        with caplog.at_level(logging.WARNING):
            m.get_estimator(horizon=0, target_dim=0)
        assert len(caplog.records) == 1
        assert caplog.records[0].levelname == "WARNING"
        assert caplog.records[0].message == (
            "Model supports multi-output; a single estimator "
            "forecasts all the horizons and components."
        )

        # univariate, deterministic, ocl > 2
        m = SKLearnModel(
            model=HistGradientBoostingRegressor(),
            lags=2,
            output_chunk_length=2,
        )
        m.fit(ts["a"])
        # horizon > ocl
        with pytest.raises(ValueError) as err:
            m.get_estimator(horizon=3, target_dim=0)
        assert str(err.value).startswith(
            "`horizon` must be `>= 0` and `< output_chunk_length"
        )
        # target dim > training series width
        with pytest.raises(ValueError) as err:
            m.get_estimator(horizon=0, target_dim=1)
        assert str(err.value).startswith(
            "`target_dim` must be `>= 0`, and `< n_target_components="
        )

        # univariate, probabilistic
        # using the quantiles argument to force wrapping in MultiOutputRegressor
        m = XGBModel(
            lags=2,
            output_chunk_length=2,
            random_state=1,
            likelihood="poisson",
            quantiles=[0.5],
        )
        m.fit(ts["a"])
        # incorrect likelihood
        with pytest.raises(ValueError) as err:
            m.get_estimator(horizon=0, target_dim=0, quantile=0.1)
        assert str(err.value).startswith(
            "`quantile` is only supported for probabilistic models that "
            "use `likelihood='quantile'`."
        )

        # univariate, probabilistic
        m = XGBModel(
            lags=2,
            output_chunk_length=2,
            random_state=1,
            likelihood="quantile",
            quantiles=[0.01, 0.5, 0.99],
        )
        m.fit(ts["a"])
        # retrieving a non-defined quantile
        with pytest.raises(ValueError) as err:
            m.get_estimator(horizon=0, target_dim=0, quantile=0.1)
        assert str(err.value).startswith(
            "Invalid `quantile=0.1`. Must be one of the fitted quantiles "
            "`[0.01, 0.5, 0.99]`."
        )
Check that all the corner-cases are properly covered by the method
darts/tests/models/forecasting/test_sklearn_models.py