mixo_pls
(通過 pls()
)、mixo_spls
(通過 spls()
)和 mixo_plsda
(通過 plsda()
)對象是使用 mixOmics 包創建的,用於擬合偏最小二乘模型。
用法
# S3 method for mixo_pls
axe_call(x, verbose = FALSE, ...)
# S3 method for mixo_spls
axe_call(x, verbose = FALSE, ...)
# S3 method for mixo_pls
axe_data(x, verbose = FALSE, ...)
# S3 method for mixo_spls
axe_data(x, verbose = FALSE, ...)
# S3 method for mixo_pls
axe_fitted(x, verbose = FALSE, ...)
# S3 method for mixo_spls
axe_fitted(x, verbose = FALSE, ...)
例子
library(butcher)
do.call(library, list(package = "mixOmics"))
#>
#> Loaded mixOmics 6.24.0
#> Thank you for using mixOmics!
#> Tutorials: http://mixomics.org
#> Bookdown vignette: https://mixomicsteam.github.io/Bookdown
#> Questions, issues: Follow the prompts at http://mixomics.org/contact-us
#> Cite us: citation('mixOmics')
#>
#> Attaching package: ‘mixOmics’
#> The following objects are masked from ‘package:caret’:
#>
#> nearZeroVar, plsda, splsda
#> The following objects are masked from ‘package:parsnip’:
#>
#> pls, tune
# pls ------------------------------------------------------------------
fit_mod <- function() {
boop <- runif(1e6)
pls(matrix(rnorm(2e4), ncol = 2), rnorm(1e4), mode = "classic")
}
mod_fit <- fit_mod()
mod_res <- butcher(mod_fit)
weigh(mod_fit)
#> # A tibble: 24 × 2
#> object size
#> <chr> <dbl>
#> 1 X 0.842
#> 2 Y 0.762
#> 3 names.sample 0.681
#> 4 variates.X 0.201
#> 5 variates.Y 0.201
#> 6 input.X 0.161
#> 7 call 0.00129
#> 8 loadings.X 0.000776
#> 9 loadings.Y 0.000696
#> 10 loadings.star1 0.0006
#> # ℹ 14 more rows
weigh(mod_res)
#> # A tibble: 24 × 2
#> object size
#> <chr> <dbl>
#> 1 X 0.842
#> 2 Y 0.762
#> 3 variates.X 0.201
#> 4 variates.Y 0.201
#> 5 loadings.X 0.000776
#> 6 loadings.Y 0.000696
#> 7 loadings.star1 0.0006
#> 8 mat.c 0.0006
#> 9 loadings.star2 0.00052
#> 10 prop_expl_var.X 0.000352
#> # ℹ 14 more rows
new_data <- matrix(1:2, ncol = 2)
colnames(new_data) <- c("X1", "X2")
predict(mod_fit, new_data)
#>
#> Call:
#> predict.mixo_pls(object = mod_fit, newdata = new_data)
#>
#> Main numerical outputs:
#> --------------------
#> Prediction values of the test samples for each component: see object$predict
#> variates of the test samples: see object$variates
predict(mod_res, new_data)
#>
#> Call:
#> predict.mixo_pls(object = mod_res, newdata = new_data)
#>
#> Main numerical outputs:
#> --------------------
#> Prediction values of the test samples for each component: see object$predict
#> variates of the test samples: see object$variates
相關用法
- R butcher axe-flexsurvreg 砍掉一個flexsurvreg。
- R butcher axe-ranger 砍掉一名護林員。
- R butcher axe-ipred 砍倒一棵裝袋的樹。
- R butcher axe-train.recipe 砍掉一個 train.recipe 對象。
- R butcher axe-terms 取消術語輸入。
- R butcher axe-survreg 砍掉一個 survreg。
- R butcher axe-mda 砍掉 mda。
- R butcher axe-earth 砍伐地球物體。
- R butcher axe-spark 砍掉一個Spark物體。
- R butcher axe-gausspr 砍掉高斯。
- R butcher axe-survreg.penal 取消監管處罰
- R butcher axe-glmnet 砍掉 glmnet。
- R butcher axe-rpart 砍掉一個零件。
- R butcher axe-nnet 砍掉一個網絡。
- R butcher axe-formula 取消公式。
- R butcher axe-kknn 砍掉 kknn。
- R butcher axe-bart 砍掉巴特模型。
- R butcher axe-sclass 砍掉一個 sclass 對象。
- R butcher axe-model_fit 取消 model_fit。
- R butcher axe-recipe 砍掉一個配方對象。
- R butcher axe-randomForest 砍掉隨機森林。
- R butcher axe-multnet 砍掉多網。
- R butcher axe-gam 砍掉一個遊戲。
- R butcher axe-mass 砍掉 MASS 判別分析對象。
- R butcher axe-lm 砍掉一部電影。
注:本文由純淨天空篩選整理自Davis Vaughan等大神的英文原創作品 Axing mixOmics models。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。