| Title: | MLX-Accelerated Statistical Models |
|---|---|
| Description: | Fast statistical routines on Apple Silicon using the Rmlx package. |
| Authors: | David Hugh-Jones [aut, cre], R Core Team [ctb], Trevor Hastie [ctb], Jerome Friedman [ctb], Rob Tibshirani [ctb], Balasubramanian Narasimhan [ctb], Kenneth Tay [ctb], Noah Simon [ctb], James Yang [ctb], Achim Zeileis [ctb] |
| Maintainer: | David Hugh-Jones <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.3.0 |
| Built: | 2026-05-27 11:02:04 UTC |
| Source: | https://github.com/hughjonesd/RmlxStats |
These generics are re-exported from the generics package for convenience.
tidy(x, ...) glance(x, ...) augment(x, ...)tidy(x, ...) glance(x, ...) augment(x, ...)
x, ...
|
Passed to the generic. |
Construct a binomial GLM family whose core link and deviance helpers are implemented in R so they work with MLX arrays as well as base R vectors. This avoids calling into compiled C routines that only handle base types.
mlxs_binomial(link = "logit")mlxs_binomial(link = "logit")
link |
a specification for the model link function. This can be
a name/expression, a literal character string, a length-one character
vector, or an object of class
The The |
Currently the logit, log, cloglog, and cauchit links are supported.
For other link specifications, fall back to stats::binomial().
A family object compatible with stats::glm() and mlxs_glm().
mlxs_boot() resamples observations from one or more MLX arrays, calls a
user-supplied function on each resampled batch, and returns the collected
results. Every argument supplied via ... must share the same size in its
first dimension (number of observations). Arguments that do not need
resampling should be captured in the environment of fun instead of being
passed through ....
mlxs_boot(fun, ..., B = 200L, seed = NULL, progress = FALSE, compile = FALSE)mlxs_boot(fun, ..., B = 200L, seed = NULL, progress = FALSE, compile = FALSE)
fun |
Function called on each bootstrap draw. It must accept the same
named arguments as supplied through |
... |
Arrays, matrices, or vectors that should be resampled along the
first dimension before being passed to |
B |
Number of bootstrap iterations. |
seed |
Optional integer seed for reproducibility. |
progress |
Logical; if |
compile |
Logical; compile |
A list with elements samples (the raw results from fun), B, and
seed.
Cross-validation wrapper around mlxs_glmnet() that mirrors the core
glmnet::cv.glmnet() workflow for the families currently supported by
mlxs_glmnet().
mlxs_cv_glmnet( x, y, weights = NULL, offset = NULL, lambda = NULL, type.measure = c("default", "mse", "deviance", "class", "mae", "auc", "C"), nfolds = 10, foldid = NULL, alignment = c("lambda", "fraction"), grouped = TRUE, keep = FALSE, parallel = FALSE, gamma = c(0, 0.25, 0.5, 0.75, 1), relax = FALSE, trace.it = 0, family = mlxs_gaussian(), ... )mlxs_cv_glmnet( x, y, weights = NULL, offset = NULL, lambda = NULL, type.measure = c("default", "mse", "deviance", "class", "mae", "auc", "C"), nfolds = 10, foldid = NULL, alignment = c("lambda", "fraction"), grouped = TRUE, keep = FALSE, parallel = FALSE, gamma = c(0, 0.25, 0.5, 0.75, 1), relax = FALSE, trace.it = 0, family = mlxs_gaussian(), ... )
x |
Numeric matrix of predictors (observations in rows). |
y |
Numeric response vector. |
weights |
Optional observation weights. Currently unsupported. |
offset |
Optional offset. Currently unsupported. |
lambda |
Optional decreasing lambda sequence. If |
type.measure |
Loss used to score the holdout predictions. |
nfolds |
Number of folds. |
foldid |
Optional integer vector giving the fold assignment for each observation. |
alignment |
Alignment mode. Only |
grouped |
Should cross-validation be aggregated fold-by-fold? Only
|
keep |
Should out-of-fold predictions be stored? |
parallel |
Logical. Parallel refits are currently unsupported. |
gamma, relax
|
Relaxed fits are currently unsupported. |
trace.it |
Progress tracing. Currently unsupported. |
family |
MLX-aware family object, e.g. |
... |
Additional arguments passed to |
The full-data fit defines a master lambda path. Each fold is then refit on the same lambda values and scored on its holdout set.
Current limitations relative to glmnet::cv.glmnet():
only Gaussian and binomial families are supported
weights, offset, alignment != "lambda", grouped = FALSE,
parallel = TRUE, relax = TRUE, and non-zero trace.it are not
implemented
type.measure = "auc" and type.measure = "C" are not implemented
An object of class mlxs_cv_glmnet.
MLX-friendly Gaussian family
mlxs_gaussian(link = "identity")mlxs_gaussian(link = "identity")
link |
a specification for the model link function. This can be
a name/expression, a literal character string, a length-one character
vector, or an object of class
The The |
A family object compatible with mlxs_glm().
Fit generalized linear models using iterative reweighted least squares (IRLS) with MLX providing the heavy lifting for weighted least squares solves. Final convergence is done at double precision on the cpu.
mlxs_glm( formula, family = mlxs_gaussian(), data, subset, weights, na.action = stats::na.exclude, start = NULL, control = list(), ... )mlxs_glm( formula, family = mlxs_gaussian(), data, subset, weights, na.action = stats::na.exclude, start = NULL, control = list(), ... )
formula |
Model formula. |
family |
A mlxs family object (e.g., |
data |
Optional data frame, tibble, or environment containing the variables in the model. |
subset |
Optional expression for subsetting observations. |
weights |
Optional non-negative observation weights. |
na.action |
How to handle missing values. |
start |
Starting values for the parameters in the linear predictor. |
control |
Optional list of control parameters passed to
|
... |
Additional arguments passed to the family function when |
An object of class c("mlxs_glm", "mlxs_model") containing elements
similar to the result of stats::glm(). Unlike stats::glm(),
rank-deficient model matrices are rejected rather than fit with aliased
coefficients.
fit <- mlxs_glm(mpg ~ cyl + disp, family = mlxs_gaussian(), data = mtcars) coef(fit)fit <- mlxs_glm(mpg ~ cyl + disp, family = mlxs_gaussian(), data = mtcars) coef(fit)
Control parameters
mlxs_glm_control( epsilon = 1e-08, epsilon_f64 = 1e-06, maxit = 25, trace = FALSE, rank_tol = NULL )mlxs_glm_control( epsilon = 1e-08, epsilon_f64 = 1e-06, maxit = 25, trace = FALSE, rank_tol = NULL )
epsilon |
Convergence tolerance parameter, interpreted as in
|
epsilon_f64 |
Move operations to float64 on the cpu when convergence is this close (using the same expression as above). Doing this allows more precision but slows computation. |
maxit |
Maximum number of IWLS iterations. |
trace |
Logical: trace each iteration? |
rank_tol |
Optional relative tolerance used to detect rank-deficient
systems. |
A list with default values filled in.
Fit lasso or elastic-net penalised regression paths using MLX arrays for the
heavy linear algebra. Dense Gaussian and binomial paths stay on the MLX
backend throughout the iterative updates, with repeated chunk updates traced
through Rmlx::mlx_compile() to reduce host overhead.
mlxs_glmnet( x, y, family = mlxs_gaussian(), alpha = 1, lambda = NULL, nlambda = 100, lambda_min_ratio = 1e-04, standardize = TRUE, intercept = TRUE, use_strong_rules = TRUE, maxit = 1000, tol = 1e-06 )mlxs_glmnet( x, y, family = mlxs_gaussian(), alpha = 1, lambda = NULL, nlambda = 100, lambda_min_ratio = 1e-04, standardize = TRUE, intercept = TRUE, use_strong_rules = TRUE, maxit = 1000, tol = 1e-06 )
x |
Numeric R or mlx matrix of predictors. |
y |
Numeric R or mlx response vector. |
family |
MLX-aware family object, e.g. |
alpha |
Elastic-net mixing parameter (1 = lasso, currently alpha must be strictly positive). |
lambda |
Optional decreasing sequence of penalty values. If |
nlambda |
Length of automatically generated lambda path. |
lambda_min_ratio |
Smallest lambda as a fraction of |
standardize |
Should columns of |
intercept |
Should an intercept be fit? |
use_strong_rules |
Retained for API compatibility. The dense MLX solver keeps all coefficients on device, so this flag currently does not change the computation. |
maxit |
Maximum proximal-gradient iterations per lambda value. |
tol |
Convergence tolerance on the coefficient updates. |
An object of class mlxs_glmnet containing the fitted coefficient
path, intercepts, lambda sequence, and scaling information. The beta and
a0 components are stored as MLX arrays so downstream methods can keep
path computations on the MLX backend. Use coef() or predict() for
ordinary base-R matrix outputs.
glmnet::glmnet() is faster on smaller problems. Very roughly
as of April 2026, mlxs_glmnet() gets competitive at n x p = 5,000,000
or greater.
Fit a linear model via QR decomposition using MLX arrays on Apple Silicon
devices. The interface mirrors stats::lm() for the common arguments.
mlxs_lm( formula, data, subset, weights, na.action = stats::na.exclude, rank_tol = NULL )mlxs_lm( formula, data, subset, weights, na.action = stats::na.exclude, rank_tol = NULL )
formula |
Model formula. |
data |
Optional data frame, tibble, or environment containing the variables in the model. |
subset |
Optional expression for subsetting observations. |
weights |
Optional non-negative observation weights. |
na.action |
How to handle missing values. |
rank_tol |
Optional relative tolerance used to detect rank-deficient
systems. |
An object of class c("mlxs_lm", "mlxs_model") containing
components similar to an "lm" fit, along with MLX intermediates stored in
the mlx element.
Note that MLX currently operates in single precision, so fitted values and
diagnostics may differ from stats::lm() at around the 1e-6 level. Unlike
stats::lm(), rank-deficient model matrices are rejected rather than fit
with aliased coefficients.
fit <- mlxs_lm(mpg ~ cyl + disp, data = mtcars) coef(fit)fit <- mlxs_lm(mpg ~ cyl + disp, data = mtcars) coef(fit)
mlxs_lm_fit() powers mlxs_lm() by wrapping the QR-based solver that runs
entirely on MLX arrays.
mlxs_lm_fit(x, y, weights = NULL, rank_tol = NULL)mlxs_lm_fit(x, y, weights = NULL, rank_tol = NULL)
x |
MLX design matrix (or object coercible via |
y |
MLX column vector (or object coercible via |
weights |
Optional MLX column vector or numeric vector of non-negative observation weights. When supplied, weighted least squares are fit via the standard square-root weighting. |
rank_tol |
Optional relative tolerance used to detect rank-deficient
systems. |
Inputs that are not already MLX objects are converted with
Rmlx::as_mlx() or Rmlx::mlx_matrix() so callers can provide base-R
matrices or vectors. Weighted fits are performed by applying the standard
square-root weight transform before solving the QR system.
A list with components coefficients, fitted.values, residuals,
effects, and qr, mirroring the corresponding pieces of stats::lm().
Array-valued components remain MLX matrices to keep downstream GPU
pipelines in device memory.
x <- Rmlx::as_mlx(cbind(1, as.matrix(mtcars[c("cyl", "disp")]))) y <- Rmlx::mlx_matrix(mtcars$mpg, ncol = 1) fit <- mlxs_lm_fit(x, y) drop(as.matrix(fit$coefficients))x <- Rmlx::as_mlx(cbind(1, as.matrix(mtcars[c("cyl", "disp")]))) y <- Rmlx::mlx_matrix(mtcars$mpg, ncol = 1) fit <- mlxs_lm_fit(x, y) drop(as.matrix(fit$coefficients))
MLX-friendly Poisson family
mlxs_poisson(link = "log")mlxs_poisson(link = "log")
link |
a specification for the model link function. This can be
a name/expression, a literal character string, a length-one character
vector, or an object of class
The The |
A family object compatible with mlxs_glm().
Perform principal components analysis with MLX arrays, keeping the centred and scaled data on device throughout the decomposition.
mlxs_prcomp( x, retx = TRUE, center = TRUE, scale. = FALSE, tol = NULL, rank. = NULL, oversample = NULL, n_iter = 2L, seed = 1L, ... )mlxs_prcomp( x, retx = TRUE, center = TRUE, scale. = FALSE, tol = NULL, rank. = NULL, oversample = NULL, n_iter = 2L, seed = 1L, ... )
x |
Numeric matrix-like object or MLX array with observations in rows. |
retx |
Should the rotated scores be returned? |
center, scale.
|
Passed to |
tol |
Optional tolerance for omitting components with small standard deviations, relative to the leading component. |
rank. |
Optional maximal rank. If smaller than |
oversample |
Oversampling added to the randomized subspace dimension.
If |
n_iter |
Number of randomized power iterations. Ignored for exact fits. |
seed |
Seed used for the randomized projection basis. Ignored for exact fits. |
... |
Additional arguments are rejected for compatibility with
|
The interface follows stats::prcomp() closely. Full-rank fits use an exact
decomposition. When rank. is supplied and smaller than min(nrow(x), ncol(x)), a randomized truncated PCA path is used instead.
The randomized path first sketches a slightly larger subspace than the
requested rank, then compresses back down to the requested components. The
oversample parameter controls how much extra space is used in that sketch:
larger values make it less likely that the random sketch misses part of the
leading principal subspace. The n_iter parameter applies additional power
iterations, which improve accuracy when the singular values decay slowly but
require extra passes over the matrix.
By default, oversample is chosen as
min(rank., max(10, ceiling(rank. / 2))), which keeps the usual
constant-size oversampling for small target ranks while allowing more slack
for larger truncated fits. This follows common randomized SVD guidance to
start with modest oversampling, often around 5 to 10, and to increase
oversampling before increasing the number of power iterations.
An object of class c("mlxs_prcomp", "prcomp").
Halko, N., Martinsson, P.-G., and Tropp, J. A. (2011). Finding Structure with Randomness: Probabilistic Algorithms for Constructing Approximate Matrix Decompositions. SIAM Review, 53(2), 217-288.
Musco, C. and Musco, C. (2015). Randomized Block Krylov Methods for Stronger and Faster Approximate Singular Value Decomposition. NeurIPS 2015.
MLX-friendly quasibinomial family
mlxs_quasibinomial(link = "logit")mlxs_quasibinomial(link = "logit")
link |
a specification for the model link function. This can be
a name/expression, a literal character string, a length-one character
vector, or an object of class
The The |
A family object compatible with mlxs_glm().
MLX-friendly quasipoisson family
mlxs_quasipoisson(link = "log")mlxs_quasipoisson(link = "log")
link |
a specification for the model link function. This can be
a name/expression, a literal character string, a length-one character
vector, or an object of class
The The |
A family object compatible with mlxs_glm().
Support functions that provide a familiar S3 surface for mlxs_glm
fits by delegating to equivalent base glm behaviour where helpful.
## S3 method for class 'mlxs_glm' weights(object, type = c("prior", "working"), ...) ## S3 method for class 'mlxs_glm' predict( object, newdata = NULL, type = c("link", "response"), se.fit = FALSE, ... ) ## S3 method for class 'mlxs_glm' fitted(object, ...) ## S3 method for class 'mlxs_glm' residuals(object, type = c("deviance", "pearson", "working", "response"), ...) ## S3 method for class 'mlxs_glm' vcov(object, ...) ## S3 method for class 'mlxs_glm' confint( object, parm, level = 0.95, ..., bootstrap = FALSE, bootstrap_args = list(B = 200L, seed = NULL, progress = FALSE, bootstrap_type = "case") ) ## S3 method for class 'mlxs_glm' print(x, digits = max(3, getOption("digits") - 3), ...) ## S3 method for class 'mlxs_glm' summary( object, bootstrap = FALSE, bootstrap_args = list(B = 200L, seed = NULL, progress = FALSE, bootstrap_type = "case"), confint = FALSE, level = 0.95, ... ) ## S3 method for class 'summary.mlxs_glm' print(x, digits = max(3, getOption("digits") - 3), ...) ## S3 method for class 'mlxs_glm' anova(object, ...) ## S3 method for class 'mlxs_glm' model.frame(formula, ...) ## S3 method for class 'mlxs_glm' model.matrix(object, ...) ## S3 method for class 'mlxs_glm' terms(x, ...) ## S3 method for class 'mlxs_glm' nobs(object, ...) ## S3 method for class 'mlxs_glm' tidy(x, ...) ## S3 method for class 'mlxs_glm' glance(x, ...) ## S3 method for class 'mlxs_glm' augment( x, data = x$model, newdata = NULL, type.predict = c("response", "link"), type.residuals = c("response", "deviance"), se_fit = FALSE, output = c("data.frame", "mlx"), ... ) ## S3 method for class 'mlxs_glm' estfun(x, ..., output = c("matrix", "mlx")) ## S3 method for class 'mlxs_glm' hatvalues(model, ..., output = c("matrix", "mlx")) ## S3 method for class 'mlxs_glm' bread(x, ...)## S3 method for class 'mlxs_glm' weights(object, type = c("prior", "working"), ...) ## S3 method for class 'mlxs_glm' predict( object, newdata = NULL, type = c("link", "response"), se.fit = FALSE, ... ) ## S3 method for class 'mlxs_glm' fitted(object, ...) ## S3 method for class 'mlxs_glm' residuals(object, type = c("deviance", "pearson", "working", "response"), ...) ## S3 method for class 'mlxs_glm' vcov(object, ...) ## S3 method for class 'mlxs_glm' confint( object, parm, level = 0.95, ..., bootstrap = FALSE, bootstrap_args = list(B = 200L, seed = NULL, progress = FALSE, bootstrap_type = "case") ) ## S3 method for class 'mlxs_glm' print(x, digits = max(3, getOption("digits") - 3), ...) ## S3 method for class 'mlxs_glm' summary( object, bootstrap = FALSE, bootstrap_args = list(B = 200L, seed = NULL, progress = FALSE, bootstrap_type = "case"), confint = FALSE, level = 0.95, ... ) ## S3 method for class 'summary.mlxs_glm' print(x, digits = max(3, getOption("digits") - 3), ...) ## S3 method for class 'mlxs_glm' anova(object, ...) ## S3 method for class 'mlxs_glm' model.frame(formula, ...) ## S3 method for class 'mlxs_glm' model.matrix(object, ...) ## S3 method for class 'mlxs_glm' terms(x, ...) ## S3 method for class 'mlxs_glm' nobs(object, ...) ## S3 method for class 'mlxs_glm' tidy(x, ...) ## S3 method for class 'mlxs_glm' glance(x, ...) ## S3 method for class 'mlxs_glm' augment( x, data = x$model, newdata = NULL, type.predict = c("response", "link"), type.residuals = c("response", "deviance"), se_fit = FALSE, output = c("data.frame", "mlx"), ... ) ## S3 method for class 'mlxs_glm' estfun(x, ..., output = c("matrix", "mlx")) ## S3 method for class 'mlxs_glm' hatvalues(model, ..., output = c("matrix", "mlx")) ## S3 method for class 'mlxs_glm' bread(x, ...)
object, model
|
An |
type |
Character string indicating the scale of the prediction or residuals to return. |
... |
Additional arguments passed to underlying methods. |
newdata |
Optional data frame used for prediction. |
se.fit |
Logical. Should standard errors of the fit be returned when supported? |
parm |
Parameter specification for confidence intervals. |
level |
Confidence level for intervals. |
bootstrap |
Logical; should bootstrap standard errors or confidence intervals be computed? |
bootstrap_args |
List of bootstrap configuration options.
See |
x |
An |
digits |
Number of significant digits to print for summaries. |
confint |
Logical; should confidence intervals be included in the summary object? |
formula, data
|
Optional formula and data overrides used by
|
type.predict, type.residuals
|
Character strings controlling the scale of
fitted values and residuals returned by |
se_fit |
Logical; standard-error analogue for |
output |
Character string; return format ("data.frame" or "mlx"). |
These helpers provide the familiar S3 surface for mlxs_lm fits.
## S3 method for class 'mlxs_lm' predict(object, newdata = NULL, ...) ## S3 method for class 'mlxs_lm' fitted(object, ...) ## S3 method for class 'mlxs_lm' residuals(object, ...) ## S3 method for class 'mlxs_lm' vcov(object, ...) ## S3 method for class 'mlxs_lm' confint( object, parm, level = 0.95, ..., bootstrap = FALSE, bootstrap_args = list(B = 200L, seed = NULL, progress = FALSE, bootstrap_type = "case") ) ## S3 method for class 'mlxs_lm' anova(object, ...) ## S3 method for class 'mlxs_anova' as.data.frame(x, row.names = NULL, optional = FALSE, ...) ## S3 method for class 'mlxs_anova' print(x, ...) ## S3 method for class 'mlxs_anova' tidy(x, ...) ## S3 method for class 'mlxs_lm' summary( object, bootstrap = FALSE, bootstrap_args = list(B = 200L, seed = NULL, progress = FALSE, bootstrap_type = "case"), confint = FALSE, level = 0.95, ... ) ## S3 method for class 'mlxs_lm' print(x, ...) ## S3 method for class 'summary.mlxs_lm' print(x, ...) ## S3 method for class 'mlxs_lm' model.frame(formula, ...) ## S3 method for class 'mlxs_lm' model.matrix(object, ...) ## S3 method for class 'mlxs_lm' terms(x, ...) ## S3 method for class 'mlxs_lm' nobs(object, ...) ## S3 method for class 'mlxs_lm' tidy(x, ...) ## S3 method for class 'mlxs_lm' glance(x, ...) ## S3 method for class 'mlxs_lm' augment( x, data = model.frame(x), newdata = NULL, se_fit = FALSE, output = c("data.frame", "mlx"), ... ) ## S3 method for class 'mlxs_lm' estfun(x, ..., output = c("matrix", "mlx")) ## S3 method for class 'mlxs_lm' hatvalues(model, ..., output = c("matrix", "mlx")) ## S3 method for class 'mlxs_lm' bread(x, ...)## S3 method for class 'mlxs_lm' predict(object, newdata = NULL, ...) ## S3 method for class 'mlxs_lm' fitted(object, ...) ## S3 method for class 'mlxs_lm' residuals(object, ...) ## S3 method for class 'mlxs_lm' vcov(object, ...) ## S3 method for class 'mlxs_lm' confint( object, parm, level = 0.95, ..., bootstrap = FALSE, bootstrap_args = list(B = 200L, seed = NULL, progress = FALSE, bootstrap_type = "case") ) ## S3 method for class 'mlxs_lm' anova(object, ...) ## S3 method for class 'mlxs_anova' as.data.frame(x, row.names = NULL, optional = FALSE, ...) ## S3 method for class 'mlxs_anova' print(x, ...) ## S3 method for class 'mlxs_anova' tidy(x, ...) ## S3 method for class 'mlxs_lm' summary( object, bootstrap = FALSE, bootstrap_args = list(B = 200L, seed = NULL, progress = FALSE, bootstrap_type = "case"), confint = FALSE, level = 0.95, ... ) ## S3 method for class 'mlxs_lm' print(x, ...) ## S3 method for class 'summary.mlxs_lm' print(x, ...) ## S3 method for class 'mlxs_lm' model.frame(formula, ...) ## S3 method for class 'mlxs_lm' model.matrix(object, ...) ## S3 method for class 'mlxs_lm' terms(x, ...) ## S3 method for class 'mlxs_lm' nobs(object, ...) ## S3 method for class 'mlxs_lm' tidy(x, ...) ## S3 method for class 'mlxs_lm' glance(x, ...) ## S3 method for class 'mlxs_lm' augment( x, data = model.frame(x), newdata = NULL, se_fit = FALSE, output = c("data.frame", "mlx"), ... ) ## S3 method for class 'mlxs_lm' estfun(x, ..., output = c("matrix", "mlx")) ## S3 method for class 'mlxs_lm' hatvalues(model, ..., output = c("matrix", "mlx")) ## S3 method for class 'mlxs_lm' bread(x, ...)
object, model
|
An |
newdata |
Optional data frame for prediction. |
... |
Additional arguments passed to underlying methods. |
parm |
Parameter specification for confidence intervals. |
level |
Confidence level for intervals. |
bootstrap |
Logical; should bootstrap standard errors or confidence intervals be computed? |
bootstrap_args |
List of bootstrap configuration options.
See |
x |
An |
row.names |
Optional row names for data frame conversion. |
optional |
Logical; passed to |
confint |
Logical; should confidence intervals be included in the summary object? |
formula |
An |
data |
Optional data frame for |
se_fit |
Logical; should standard errors of fit be included? |
output |
Character string; return format ("data.frame", "matrix", "vector" or "mlx"). To make methods from other packages work, the usual default is to return a base R object. |
Methods for behavior shared by mlxs_lm and mlxs_glm through their
mlxs_model superclass.
## S3 method for class 'mlxs_model' update(object, ..., evaluate = TRUE) ## S3 method for class 'mlxs_model' coef(object, ..., output = c("vector", "mlx"))## S3 method for class 'mlxs_model' update(object, ..., evaluate = TRUE) ## S3 method for class 'mlxs_model' coef(object, ..., output = c("vector", "mlx"))
object |
An |
... |
Additional arguments passed to underlying methods. |
evaluate |
Logical; evaluate the updated call? |
mlxs_prcomp
predict.mlxs_prcomp() returns MLX scores. summary() and plot() only
materialize standard deviations for base-style output; print() and
biplot() materialize rotations and scores as needed for display.
## S3 method for class 'mlxs_prcomp' predict(object, newdata, ...) ## S3 method for class 'mlxs_prcomp' print(x, ...) ## S3 method for class 'mlxs_prcomp' summary(object, ...) ## S3 method for class 'mlxs_prcomp' plot(x, main = deparse1(substitute(x)), ...) ## S3 method for class 'mlxs_prcomp' biplot(x, ...) ## S3 method for class 'mlxs_prcomp' nobs(object, ...) ## S3 method for class 'mlxs_prcomp' tidy(x, ...) ## S3 method for class 'mlxs_prcomp' augment(x, data = NULL, newdata = NULL, output = c("data.frame", "mlx"), ...)## S3 method for class 'mlxs_prcomp' predict(object, newdata, ...) ## S3 method for class 'mlxs_prcomp' print(x, ...) ## S3 method for class 'mlxs_prcomp' summary(object, ...) ## S3 method for class 'mlxs_prcomp' plot(x, main = deparse1(substitute(x)), ...) ## S3 method for class 'mlxs_prcomp' biplot(x, ...) ## S3 method for class 'mlxs_prcomp' nobs(object, ...) ## S3 method for class 'mlxs_prcomp' tidy(x, ...) ## S3 method for class 'mlxs_prcomp' augment(x, data = NULL, newdata = NULL, output = c("data.frame", "mlx"), ...)
object, x
|
A fitted |
newdata |
Optional new observations to project. |
... |
Passed through to the corresponding base method. |
data |
Optional original data to append PCA scores to in
|
output |
Output format for |
Method-specific output. predict.mlxs_prcomp() returns an MLX
matrix. augment.mlxs_prcomp() returns either a data frame or MLX matrix.