VarSel | R Documentation |
This class implements a learner. A VarSel object can only exist as a component of a TrainLayer or a TrainMetaLayer object.
new()
Variable selection parameter list.
Learner ID.
VarSel$new( id, package = NULL, varsel_fct, varsel_param, train_layer, na_action = "na.rm" )
id
character
Package that implements the variable selection function.
If NULL, the variable selection function is called from
the current environment.
package
character
Variable selection function name. Note: Variable selection functions, except Boruta
, must return a vector of selected variables.
varsel_fct
character
Variable selection parameters.
varsel_param
list
Layer on which the learner is stored.
train_layer
TrainLayer
The training layer where to store the learner.
na_action
character
Handling of missing values in meta-data. Set to "na.keep" to keep missing values, "na.rm" to remove individuals with missing values or "na.impute" (only applicable on meta-data) to impute missing values in meta-data. Only median and mode based imputations are actually handled. With the "na.keep" option, ensure that the provided learner can handle missing values.
If TRUE
, the individuals with missing predictor values will be removed from the training dataset.
print()
Printer
VarSel$print(...)
...
any
summary()
Summary
VarSel$summary(...)
...
any
interface()
Learner and prediction parameter interface. Use this function
to provide how the following parameters are named in the learning
function (lrn_fct
) you provided when creating the learner, or in the predicting function.
VarSel$interface( x = "x", y = "y", object = "object", data = "data", extract_var_fct = NULL )
x
string
Name of the argument to pass the matrix of independent variables in the original learning function.
y
string
Name of the argument to pass the response variable in the original learning function.
object
string
Name of the argument to pass the model in the original predicting function.
data
character
Name of the argument to pass new data in the original predicting function.
extract_var_fct
character
or function
If the variable selection function that is called does not return a vector, then
use this argument to specify a (or a name of a) function that can be used to extract vector of selected variables.
Default value is NULL, if selected variables are in a vector.
varSelection()
Tains the current learner (from class Lrner) on the current training data (from class TrainData).
VarSel$varSelection(ind_subset = NULL)
ind_subset
vector
Individual ID subset on which the training will be performed.
The resulting model, from class Model, is returned.
getTrainLayer()
The current layer is returned.
VarSel$getTrainLayer()
TrainLayer object.
getId()
Getter of the current learner ID.
VarSel$getId()
The current learner ID.
getPackage()
Getter of the variable selection package implementing the variable selection function.
VarSel$getPackage()
The name of the package implementing the variable selection function.
getVarSubSet()
Getter of the list of selected variables.
VarSel$getVarSubSet()
List of selected variables..
getParamInterface()
The current parameter interface is returned.
VarSel$getParamInterface()
A data.frame of interface.
getNaAction()
The current layer is returned.
VarSel$getNaAction()
getExtractVar()
The function to extract selected variables is returned.
VarSel$getExtractVar()
A data.frame of interface.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.