def fit(self, X, y):
        """Fit the model according to the given training data.

        It build a forest of trees from the training set.

        Parameters
        ----------
        X : array-like, shape = (n_samples, n_timestamps)
            Univariate time series.

        y : array-like, shape = (n_samples,)
            Class labels for each sample.

        Returns
        -------
        self : object

        """
        # Create and fit the pipeline
        feature_extractor = WindowFeatureExtractor(
            n_windows=self.n_windows, min_window_size=self.min_window_size,
            random_state=self.random_state
        )
        rfc = RandomForestClassifier(
            n_estimators=self.n_estimators,
            criterion=self.criterion,
            max_depth=self.max_depth,
            min_samples_split=self.min_samples_split,
            min_samples_leaf=self.min_samples_leaf,
            min_weight_fraction_leaf=self.min_weight_fraction_leaf,
            max_features=self.max_features,
            max_leaf_nodes=self.max_leaf_nodes,
            min_impurity_decrease=self.min_impurity_decrease,
            bootstrap=self.bootstrap,
            oob_score=self.oob_score,
            n_jobs=self.n_jobs,
            random_state=self.random_state,
            verbose=self.verbose,
            class_weight=self.class_weight,
            ccp_alpha=self.ccp_alpha,
            max_samples=self.max_samples,
            warm_start=False
        )
        self._pipeline = Pipeline([('fe', feature_extractor), ('rfc', rfc)])
        self._pipeline.fit(X, y)

        # Get attributes
        self.estimator_ = self._pipeline['rfc'].estimator_
        self.classes_ = self._pipeline['rfc'].classes_
        self.estimators_ = self._pipeline['rfc'].estimators_
        self.feature_importances_ = self._pipeline['rfc'].feature_importances_
        self.indices_ = self._pipeline['fe'].indices_
        self.n_features_in_ = (
            self._pipeline['rfc'].n_features_in_
            if hasattr(self._pipeline['rfc'], 'n_features_in_')
            else self._pipeline['rfc'].n_features_
        )
        self.oob_decision_function_ = getattr(
            self._pipeline['rfc'], 'oob_decision_function_', None)
        self.oob_score_ = getattr(self._pipeline['rfc'], 'oob_score_', None)

        return self
Fit the model according to the given training data.

        It build a forest of trees from the training set.

        Parameters
        ----------
        X : array-like, shape = (n_samples, n_timestamps)
            Univariate time series.

        y : array-like, shape = (n_samples,)
            Class labels for each sample.

        Returns
        -------
        self : object

        
pyts/classification/time_series_forest.py