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

        It generates the indices of the windows from which the features will be
        extracted.

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

        y
            Ignored

        Returns
        -------
        self : object

        """
        X = check_array(X, dtype='float64')
        n_timestamps = X.shape[1]

        (min_subsequence_size, min_interval_size, n_subsequences,
         rng) = self._check_params(X, n_timestamps)

        # Define the parameters of the subseries and intervals
        n_intervals = int(min_subsequence_size / min_interval_size)
        min_subseries_size = min_interval_size * n_intervals
        if n_subsequences == 'auto':
            n_subseries = max(
                1, n_timestamps // min_interval_size - n_intervals)
        else:
            n_subseries = n_subsequences

        # Generate the indices of the subseries
        subseries_start = rng.randint(
            0, n_timestamps - min_subseries_size + 1, size=n_subseries
        )
        subseries_end = rng.randint(
            subseries_start + min_subseries_size, n_timestamps + 1,
            size=n_subseries
        )

        # Generate the indices of the intervals
        interval_indices = np.linspace(
            subseries_start, subseries_end, n_intervals + 1, axis=1
        ).astype('int64')

        # Save the relevant parameters as attributes
        self.interval_indices_ = interval_indices
        self.min_subsequence_size_ = min_subsequence_size

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

        It generates the indices of the windows from which the features will be
        extracted.

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

        y
            Ignored

        Returns
        -------
        self : object

        
pyts/classification/tsbf.py