Last data update: 2014.03.03
R: Wavelet levels selection procedure
selectLevel R Documentation
Wavelet levels selection procedure
Description
A grouped backward variable selection procedure for selecting the most significant wavelet levels of a functional variable. The groups are the wavelet coefficients belonging to the same frequency level.
Usage
selectLevel(design, ydata, typeRF = ifelse(is.factor(ydata), "classif", "reg"),
verbose = TRUE, ntree = 500, ...)
Arguments
design
The design matrix of a functional variable.
ydata
The outcome data. Must be a factor for classification.
typeRF
The type of forest we want to construct, ‘classif’ for classification or ‘reg’ for regression.
verbose
Should the details be printed.
ntree
The number of trees in the forests (default: 500).
...
optional parameters to be passed to the ‘varImpGroup’ function.
Value
An object of class fRFE which is a list with the following components:
nselected
The number of selected wavelet levels.
selection
The selected wavelet levels.
selectionIndexes
The indexes of selected wavelet levels in the input matrix ‘design’.
error
The prediction error computed in each iteration of the backward procedure.
typeRF
The type of the forests, classification or regression.
ranking
The final ranking of the wavelet levels.
rankingIndexes
The final ranking indexes of the wavelet levels.
Author(s)
Baptiste Gregorutti
References
Gregorutti, B., Michel, B. and Saint Pierre, P. (2015). Grouped variable importance with random forests and application to multiple functional data analysis, Computational Statistics and Data Analysis 90, 15-35.
See Also
selectGroup
,selectFunctional
,varImpGroup
Examples
data(toyRegFD)
x <- toyRegFD$FDlist[[1]]
y <- toyRegFD$Y
design <- projectWavelet(xdata=x)
summary(levSel <- selectLevel(design, y, ntree=100, verbose=TRUE))
plot(levSel)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(RFgroove)
Loading required package: randomForest
randomForest 4.6-12
Type rfNews() to see new features/changes/bug fixes.
Loading required package: wmtsa
Loading required package: fda
Loading required package: splines
Loading required package: Matrix
Attaching package: 'fda'
The following object is masked from 'package:graphics':
matplot
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RFgroove/selectLevel.Rd_%03d_medium.png", width=480, height=480)
> ### Name: selectLevel
> ### Title: Wavelet levels selection procedure
> ### Aliases: selectLevel
>
> ### ** Examples
>
> data(toyRegFD)
> x <- toyRegFD$FDlist[[1]]
> y <- toyRegFD$Y
>
> design <- projectWavelet(xdata=x)
> summary(levSel <- selectLevel(design, y, ntree=100, verbose=TRUE))
Group names: s7 d7 d6 d5 d4 d3 d2 d1 Nr of variable in each level: 1 1 2 4 8 16 32 64
normalize = TRUE
s7 d7 d6 d5 d4 d3 d2 d1
1 1 2 4 8 16 32 64
Regression backward selection.
Splitting data into a training and a testing set...
Survival indexes : 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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
d3 d1 d4 s7 d2 d7 d5 d6
0.120 0.065 0.053 0.041 0.026 0.017 0.004 0.003
d6 eliminated. 7 remaining groups of variables. Error = 1.46
Survival indexes : 1 2 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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
d3 d4 d1 s7 d2 d7 d5
0.114 0.088 0.053 0.040 0.026 0.015 0.015
d5 eliminated. 6 remaining groups of variables. Error = 1.38
Survival indexes : 1 2 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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
d3 s7 d1 d4 d2 d7
0.104 0.073 0.072 0.053 0.033 0.001
d7 eliminated. 5 remaining groups of variables. Error = 1.42
Survival indexes : 1 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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
d3 d1 d4 s7 d2
0.120 0.070 0.066 0.036 0.027
d2 eliminated. 4 remaining groups of variables. Error = 1.36
Survival indexes : 1 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
d3 d1 s7 d4
0.119 0.091 0.067 0.061
d4 eliminated. 3 remaining groups of variables. Error = 1.38
Survival indexes : 1 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
d3 d1 s7
0.135 0.102 0.042
s7 eliminated. 2 remaining groups of variables. Error = 1.41
Survival indexes : 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
d3 d1
0.135 0.108
d1 eliminated. 1 remaining groups of variables. Error = 1.45
Survival indexes : 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
d3 eliminated. No remaining groups of variables. Error = 1.33
Ending...
1 selected variables:
d3
--- ---
--- Summary functional RFE ---
--- ---
Number of selected variables using a validation set: 1
Selected variables:
d3
Validation error for the best model: 1.3325
> plot(levSel)
>
>
>
>
>
>
> dev.off()
null device
1
>