def _get_categorical_features(
        self,
        series: Union[Sequence[TimeSeries], TimeSeries],
        past_covariates: Optional[Union[Sequence[TimeSeries], TimeSeries]] = None,
        future_covariates: Optional[Union[Sequence[TimeSeries], TimeSeries]] = None,
    ) -> tuple[list[int], list[str]]:
        """
        Returns the indices and column names of the categorical features in the regression model.

        Steps:
        1. Get the list of features used in the model. We keep the creation order of the different lags/features
            in create_lagged_data.
        2. Get the indices of the categorical features in the list of features.
        """
        categorical_covariates = [
            [],  # currently no categorical target components allowed
            self.categorical_past_covariates
            if self.categorical_past_covariates
            else [],
            self.categorical_future_covariates
            if self.categorical_future_covariates
            else [],
            self.categorical_static_covariates
            if self.categorical_static_covariates
            else [],
        ]

        # if no categorical covariates are declared, return empty lists
        if sum(len(cat_cov) for cat_cov in categorical_covariates) == 0:
            return [], []

        target_ts = get_single_series(series)
        past_covs_ts = get_single_series(past_covariates)
        fut_covs_ts = get_single_series(future_covariates)

        feature_list = [
            [
                ("target", component, lag)
                for lag in self.lags.get("target", [])
                for component in target_ts.components
            ],
            [
                ("past_cov", component, lag)
                for lag in self.lags.get("past", [])
                for component in past_covs_ts.components
            ],
            [
                ("fut_cov", component, lag)
                for lag in self.lags.get("future", [])
                for component in fut_covs_ts.components
            ],
            (
                [
                    ("static_cov", component, 0)
                    for component in list(target_ts.static_covariates.columns)
                ]
                if target_ts.has_static_covariates
                else []
            ),
        ]

        # keep track of feature list index to refer to the columns indices
        index = 0
        indices = []
        col_names = []
        series_type = [
            "series",
            "past_covariates",
            "future_covariates",
            "static_covariates",
        ]
        for cat_covs, features, s_type in zip(
            categorical_covariates, feature_list, series_type
        ):
            # extract all categorical feature indices
            extracted_categorical_features = []
            for prefix, component, lag in features:
                if component in cat_covs:
                    indices.append(index)
                    col_names.append(f"{prefix}_{component}_lag{lag}")
                    extracted_categorical_features.append(component)
                index += 1

            # check that all cat components were extracted
            missing_comps = [
                comp for comp in cat_covs if comp not in extracted_categorical_features
            ]
            if missing_comps:
                raise_log(
                    ValueError(
                        f"Some `categorical_{s_type}` components "
                        f"({missing_comps}) declared at model creation are "
                        f"not present in the `{s_type}` passed to the `fit()` call. "
                        f"Available feature(s) are: {set([comp for _, comp, _ in features])}"
                    ),
                    logger=logger,
                )
        return indices, col_names

        Returns the indices and column names of the categorical features in the regression model.

        Steps:
        1. Get the list of features used in the model. We keep the creation order of the different lags/features
            in create_lagged_data.
        2. Get the indices of the categorical features in the list of features.
        
darts/models/forecasting/sklearn_model.py