Description Usage Arguments Details Value Author(s) Examples
Interfaces to pls
functions that can be used
in a pipeline implemented by magrittr
.
1 2 3 4 |
data |
data frame, tibble, list, ... |
... |
Other arguments passed to the corresponding interfaced function. |
Interfaces call their corresponding interfaced function.
Object returned by interfaced function.
Roberto Bertolusso
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | ## Not run:
library(intubate)
library(magrittr)
library(pls)
## cppls
## Original function to interface
yarn.cppls <- cppls(density ~ NIR, ncomp = 6, data = yarn, validation = "CV")
summary(yarn.cppls)
## The interface reverses the order of data and formula
yarn.cppls <- ntbt_cppls(yarn, density ~ NIR, ncomp = 6, validation = "CV")
summary(yarn.cppls)
## so it can be used easily in a pipeline.
yarn %>%
ntbt_cppls(density ~ NIR, ncomp = 6, validation = "CV") %>%
summary()
## mvr
## Original function to interface
yarn.mvr <- mvr(density ~ NIR, ncomp = 6, data = yarn, validation = "CV",
method = "oscorespls")
summary(yarn.mvr)
## The interface reverses the order of data and formula
yarn.mvr <- ntbt_mvr(yarn, density ~ NIR, ncomp = 6, validation = "CV",
method = "oscorespls")
summary(yarn.mvr)
## so it can be used easily in a pipeline.
yarn %>%
ntbt_mvr(density ~ NIR, ncomp = 6, validation = "CV",
method = "oscorespls") %>%
summary()
## pcr
## Original function to interface
yarn.pcr <- pcr(density ~ NIR, ncomp = 6, data = yarn, validation = "CV")
summary(yarn.pcr)
## The interface reverses the order of data and formula
yarn.pcr <- ntbt_pcr(yarn, density ~ NIR, ncomp = 6, validation = "CV")
summary(yarn.pcr)
## so it can be used easily in a pipeline.
yarn %>%
ntbt_pcr(density ~ NIR, ncomp = 6, validation = "CV") %>%
summary()
## plsr
## Original function to interface
yarn.plsr <- plsr(density ~ NIR, ncomp = 6, data = yarn, validation = "CV")
summary(yarn.plsr)
## The interface reverses the order of data and formula
yarn.plsr <- ntbt_plsr(yarn, density ~ NIR, ncomp = 6, validation = "CV")
summary(yarn.plsr)
## so it can be used easily in a pipeline.
yarn %>%
ntbt_plsr(density ~ NIR, ncomp = 6, validation = "CV") %>%
summary()
## End(Not run)
|
Attaching package: 'pls'
The following object is masked from 'package:stats':
loadings
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: cppls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 5.624 4.167 2.038 0.6565 0.4674 0.4446
adjCV 27.46 4.986 4.145 2.010 0.6319 0.4574 0.4375
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: cppls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 4.994 4.036 1.924 0.5724 0.4432 0.3890
adjCV 27.46 4.555 4.114 1.902 0.5614 0.4357 0.3854
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: cppls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 4.416 4.212 1.983 0.6813 0.4926 0.4447
adjCV 27.46 4.180 4.203 1.971 0.6657 0.4826 0.4358
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: oscorespls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 4.701 3.738 2.070 0.8420 0.5040 0.4431
adjCV 27.46 4.279 3.843 2.062 0.8064 0.4947 0.4409
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: oscorespls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 4.446 4.320 2.185 0.7941 0.5196 0.4483
adjCV 27.46 4.065 4.273 2.166 0.7540 0.5071 0.4426
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: oscorespls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 4.420 3.900 2.067 0.7476 0.4871 0.4503
adjCV 27.46 4.149 3.881 2.060 0.7124 0.4770 0.4417
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: svdpc
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 28.50 4.285 2.84 2.690 1.647 0.4834
adjCV 27.46 30.37 4.249 2.79 2.691 1.570 0.4725
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 52.17 98.60 99.47 99.70 99.88 99.97
density 5.50 98.15 99.40 99.58 99.95 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: svdpc
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 29.67 4.177 2.470 2.397 1.407 0.4945
adjCV 27.46 31.29 4.147 2.439 2.428 1.322 0.4825
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 52.17 98.60 99.47 99.70 99.88 99.97
density 5.50 98.15 99.40 99.58 99.95 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: svdpc
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 28.47 4.052 2.524 2.541 1.701 0.4794
adjCV 27.46 30.02 4.028 2.493 2.559 1.594 0.4680
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 52.17 98.60 99.47 99.70 99.88 99.97
density 5.50 98.15 99.40 99.58 99.95 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: kernelpls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 5.007 3.881 2.288 1.080 0.5980 0.4211
adjCV 27.46 4.529 3.863 2.267 1.036 0.5782 0.4189
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: kernelpls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 4.958 3.942 2.113 0.8831 0.4897 0.4255
adjCV 27.46 4.445 3.937 2.102 0.8397 0.4803 0.4267
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Data: X dimension: 28 268
Y dimension: 28 1
Fit method: kernelpls
Number of components considered: 6
VALIDATION: RMSEP
Cross-validated using 10 random segments.
(Intercept) 1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
CV 27.46 4.817 4.077 2.090 0.7077 0.5047 0.4609
adjCV 27.46 4.430 4.076 2.062 0.6893 0.4951 0.4563
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps 5 comps 6 comps
X 46.83 98.38 99.46 99.67 99.85 99.97
density 98.12 98.25 99.64 99.97 99.99 99.99
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.