pyanno4rt.learning_model.preprocessing.transformers._standard_scaler

Standard scaling transformer.

Overview

Classes

StandardScaler

Standard scaling transformer class.

Classes

class pyanno4rt.learning_model.preprocessing.transformers._standard_scaler.StandardScaler(center=True, scale=True)[source]

Standard scaling transformer class.

This class provides methods to fit, transform and gradientize the input features by their z-score.

Parameters:
  • center (bool, default=True) – Indicator for the centering of the data by the mean values.

  • scale (bool, default=True) – Indicator for the scaling of the data by the standard deviations.

center

See ‘Parameters’.

Type:

bool

scale

See ‘Parameters’.

Type:

bool

means

Mean values of the features (if center is false, set to zeros).

Type:

ndarray

deviations

Standard deviations of the features (if scale is false, set to ones).

Type:

ndarray

Overview

Methods

fit(features, labels)

Fit the standard scaling transformer.

transform(features, labels)

Transform the input features/labels.

compute_gradient(features)

Compute the standard scaling transformer gradient w.r.t the input features.

Members

fit(features, labels)[source]

Fit the standard scaling transformer.

Parameters:
  • features (ndarray) – Values of the input features.

  • labels (None or ndarray) – Values of the input labels.

transform(features, labels)[source]

Transform the input features/labels.

Parameters:
  • features (ndarray) – Values of the input features.

  • labels (None or ndarray) – Values of the input labels.

Returns:

  • ndarray – Transformed values of the input features.

  • None or ndarray – Transformed values of the input labels.

compute_gradient(features)[source]

Compute the standard scaling transformer gradient w.r.t the input features.

Parameters:

features (ndarray) – Values of the input features.

Returns:

Value of the standard scaling transformer gradient.

Return type:

ndarray