jasmine.preprocessing.StandardScaler

class jasmine.preprocessing.StandardScaler(epsilon: float = 1e-08)[source]

StandardScaler standardizes features by removing the mean and scaling to unit variance.

copy

If True, a copy of X will be created; otherwise, it will be modified in place.

Type:

bool

with_mean

If True, center the data before scaling.

Type:

bool

with_std

If True, scale the data to unit variance.

Type:

bool

epsilon

Small value to avoid division by zero.

Type:

float

__init__(epsilon: float = 1e-08)[source]
property is_fitted: bool

Check if the scaler has been fitted.

Returns:

True if fitted, False otherwise.

Return type:

bool

fit(X: Array)[source]

Fit the scaler to the data. :param X: Input features of shape (n_samples, n_features). :type X: jnp.ndarray

Returns:

Fitted scaler instance.

Return type:

self

transform(X: Array) Array[source]

Transform the data using the fitted parameters. :param X: Input features of shape (n_samples, n_features). :type X: jnp.ndarray

Returns:

Transformed features.

Return type:

jnp.ndarray

fit_transform(X: Array) Array[source]

Fit the scaler and transform the data in one step.

Parameters:

X (jnp.ndarray) – Input features of shape (n_samples, n_features).

Returns:

Transformed features.

Return type:

jnp.ndarray

inverse_transform(X: Array) Array[source]

Inverse transform the standardized data back to original scale.

Parameters:

X (jnp.ndarray) – Standardized features of shape (n_samples, n_features).

Returns:

Original scale features.

Return type:

jnp.ndarray