| MLZScoreScaler | R Documentation |
Standardizes features by removing the mean and scaling to unit
variance (Bessel-corrected, n - 1). The center/scale arguments follow
R's scale(): with center = FALSE, scale = TRUE
columns are divided by the root-mean-square around 0.
The *_inplace methods mutate X directly (zero-copy)
when it is a double-storage matrix; other inputs are coerced to a double
matrix first, in which case the coerced copy is modified. The (modified)
matrix is returned in both cases. X may also be an
mmap_matrix created by mem_matrix /
mem_matrix_from: the disk-backed buffer is then
bound zero-copy through the same Eigen map interface and modified in
place on disk. All scaler methods — including fit() — require the
handle to be open in "readwrite" mode, because the scaler core
binds a mutable map.
MLZScoreScaler$new()Initialize the MLZScoreScaler
MLZScoreScaler$new(center = TRUE, scale = TRUE, n_threads = NULL)
centerLogical, whether to center columns to mean 0 (default: TRUE)
scaleLogical, whether to scale columns to unit SD (default: TRUE);
around 0 instead of the mean when center = FALSE, as in R's scale().
n_threadsInteger, the thread budget of the column passes
(NULL, the default: the library's default budget,
trex_get_num_threads(), initially 1).
MLZScoreScaler$fit()Compute the centers and scales to be used for later scaling.
MLZScoreScaler$fit(X, threshold = 1e-12)
XA numeric matrix (n x p) or an mmap_matrix in
"readwrite" mode (the scaler core binds a mutable map).
thresholdDouble, lower bound for the scale statistic (default: 1e-12).
Value.
MLZScoreScaler$transform_inplace()Perform standardization by centering and scaling in-place.
MLZScoreScaler$transform_inplace(X)
XA numeric matrix (n x p) or an mmap_matrix in
"readwrite" mode.
The modified matrix X (the same handle for an mmap_matrix).
MLZScoreScaler$inverse_transform_inplace()Inverse transform to original scale.
MLZScoreScaler$inverse_transform_inplace(X)
XA numeric matrix (n x p) or an mmap_matrix in
"readwrite" mode.
The modified matrix X (the same handle for an mmap_matrix).
MLZScoreScaler$fit_transform_inplace()Fit and transform in one call, like R's scale().
MLZScoreScaler$fit_transform_inplace(X, threshold = 1e-12)
XA numeric matrix (n x p) or an mmap_matrix in
"readwrite" mode.
thresholdDouble, lower bound for the scale statistic (default: 1e-12).
The modified matrix X (the same handle for an mmap_matrix).
MLZScoreScaler$is_fitted()Check if scaler is fitted.
MLZScoreScaler$is_fitted()
Value.
MLZScoreScaler$get_dropped_indices()Get dropped (degenerate) column indices. These columns get scale factor 1 and are still centered (sklearn semantics).
MLZScoreScaler$get_dropped_indices()
Value.
MLZScoreScaler$get_center()Check if scaler centers data.
MLZScoreScaler$get_center()
Value.
MLZScoreScaler$get_scale()Check if scaler scales data to unit variance.
MLZScoreScaler$get_scale()
Value.
MLZScoreScaler$get_centers()Get the learned centers (column means).
MLZScoreScaler$get_centers()
Value.
MLZScoreScaler$get_scales()Get the learned scales (standard deviations).
MLZScoreScaler$get_scales()
Value.
MLZScoreScaler$save()Save model state to file.
MLZScoreScaler$save(filename)
filenameString path to save output.
Value.
MLZScoreScaler$load()Load model state from file.
MLZScoreScaler$load(filename)
filenameString path to load input from.
Value.
MLZScoreScaler$clone()The objects of this class are cloneable with this method.
MLZScoreScaler$clone(deep = FALSE)
deepWhether to make a deep clone.
Other ML methods:
MLElasticNet,
MLElasticNetCV,
MLLpNormScaler,
MLPCA,
MLRidge,
MLRidgeCV,
MLSVD,
ml_agglomerative_cluster(),
ml_cut_tree(),
ml_distance_metric,
ml_linkage_method
set.seed(1)
X <- matrix(rnorm(50 * 5), 50, 5)
scaler <- MLZScoreScaler$new()
scaler$fit(X)
X_std <- scaler$transform_inplace(X)
scaler$get_centers()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.