Esempio n. 1
0
    def inverse_transform(self, X):
        """Compute time series corresponding to given 1d-SAX representations.

        Parameters
        ----------
        X : array-like of shape (n_ts, sz_sax, 2 * d)
            A dataset of SAX series.

        Returns
        -------
        numpy.ndarray of shape (n_ts, sz_original_ts, d)
            A dataset of time series corresponding to the provided
            representation.
        """
        self._is_fitted()
        X = check_array(X, allow_nd=True)
        X = check_dims(X,
                       X_fit_dims=(None, None, 2 * self._X_fit_dims_[-1]),
                       check_n_features_only=True)
        X_orig = inv_transform_1d_sax(
            X,
            breakpoints_avg_middle_=self.breakpoints_avg_middle_,
            breakpoints_slope_middle_=self.breakpoints_slope_middle_,
            original_size=self._X_fit_dims_[1])
        return self._unscale(X_orig)
Esempio n. 2
0
    def inverse_transform(self, X):
        """Compute time series corresponding to given 1d-SAX representations.

        Parameters
        ----------
        X : array-like of shape (n_ts, sz_sax, 2 * d)
            A dataset of SAX series.

        Returns
        -------
        numpy.ndarray of shape (n_ts, sz_original_ts, d)
            A dataset of time series corresponding to the provided representation.
        """
        X_ = to_time_series_dataset(X, dtype=numpy.int)
        return inv_transform_1d_sax(X_,
                                    breakpoints_avg_middle_=self.breakpoints_avg_middle_,
                                    breakpoints_slope_middle_=self.breakpoints_slope_middle_,
                                    original_size=self.size_fitted_)