def apply(self, X):
        """Apply trees in the forest to X, return leaf indices.

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

        Returns
        -------
        X_leaves : array_like, shape = (n_samples, n_estimators)
            For each datapoint x in X and for each tree in the forest,
            return the index of the leaf x ends up in.

        """
        check_is_fitted(self)
        X = check_array(X, dtype='float64')
        X_new = self._pipeline['fe'].transform(X)
        return self._pipeline['rfc'].apply(X_new)
Apply trees in the forest to X, return leaf indices.

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

        Returns
        -------
        X_leaves : array_like, shape = (n_samples, n_estimators)
            For each datapoint x in X and for each tree in the forest,
            return the index of the leaf x ends up in.

        
pyts/classification/time_series_forest.py