Online Scaling and Preproessing
API Reference
rolch.OnlineScaler
__init__
The online scaler allows for incremental updating and scaling of matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
forget
|
float
|
The forget factor. Older observations will be exponentially discounted. Defaults to 0.0. |
0.0
|
to_scale
|
bool | ndarray
|
The variables to scale.
|
True
|
fit
Fit the OnlineScaler() Object for the first time.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Matrix of covariates X. |
required |
inverse_transform
Back-transform a scaled X matrix to the original domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
Scaled X matrix. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Scaled back to the original scale. |
partial_fit
Update the OnlineScaler()
for new rows of X.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
New data for X. |
required |
transform
Transform X to a mean-std scaled matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
X matrix for covariates. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: Scaled X matrix. |