reservoir_computing.tensorPCA

Classes

tensorPCA

Compute PCA on a dataset of multivariate time series represented as a 3-dimensional tensor

Module Contents

class reservoir_computing.tensorPCA.tensorPCA(n_components)

Compute PCA on a dataset of multivariate time series represented as a 3-dimensional tensor and reduce the size along the third dimension from [N, T, V] to [N, T, D], where D <= V .

The input dataset must be a 3-dimensional tensor, where the first dimension N represents the number of observations, the second dimension T represents the number of time steps in the time series, and the third dimension V represents the number of variables in the time series.

Parameters:

n_components (int) – The number of principal components to keep after the dimensionality reduction. This determines the size of the third dimension D in the output tensor.

n_components
first_eigs = None
fit(X)

Fit the tensorPCA model to the input dataset X.

Parameters:

Xnp.ndarray

Time series, 3D array of shape [N,T,V], where N is the number of time series, T is the length of each time series, and V is the number of variables in each.

Returns:

None

transform(X)

Transform the input dataset X using the tensorPCA model.

Parameters:

Xnp.ndarray

Time series, 3D array of shape [N,T,V], where N is the number of time series, T is the length of each time series, and V is the number of variables in each.

Returns:

Xpcanp.ndarray

Transformed time series, 3D array of shape [N,T,D], where N is the number of time series, T is the length of each time series, and D is the number of principal components.

fit_transform(X)

Fit the tensorPCA model to the input dataset X and transform it.

Parameters:

Xnp.ndarray

Time series, 3D array of shape [N,T,V], where N is the number of time series, T is the length of each time series, and V is the number of variables in each.

Returns:

Xpcanp.ndarray

Transformed time series, 3D array of shape [N,T,D], where N is the number of time series, T is the length of each time series, and D is the number of principal components.