standardize

Contents

standardize#

class pinnx.utils.standardize(X_train, X_test)[source]#

Standardize features by removing the mean and scaling to unit variance.

The mean and std are computed from the training data X_train using sklearn.preprocessing.StandardScaler, and then applied to the testing data X_test.

Parameters:
  • X_train – A NumPy array of shape (n_samples, n_features). The data used to compute the mean and standard deviation used for later scaling along the features axis.

  • X_test – A NumPy array.

Returns:

Instance of sklearn.preprocessing.StandardScaler. X_train: Transformed training data. X_test: Transformed testing data.

Return type:

scaler