.fit.relief {tidyfit} | R Documentation |
ReliefF and RReliefF feature selection algorithm for tidyfit
Description
Selects features for continuous or factor data using ReliefF on a 'tidyFit' R6
class. The function can be used with regress
and classify
.
Usage
## S3 method for class 'relief'
.fit(self, data = NULL)
Arguments
self |
a 'tidyFit' R6 class. |
data |
a data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). |
Details
Hyperparameters:
None. Cross validation not applicable.
Important method arguments (passed to m
)
estimator (selection algorithm to use (default is 'ReliefFequalK'))
The ReliefF algorithm is estimated using the CORElearn::attrEval
function. See ?attrEval
for more details.
Implementation
Use with regress
for regression problems and with classify
for classification problems. coef
returns the score for each feature. Select the required number of features with the largest scores.
The Relief objects have no predict
and related methods.
Value
A fitted 'tidyFit' class model.
Author(s)
Johann Pfitzinger
References
Robnik-Sikonja M, Savicky P (2021). CORElearn: Classification, Regression and Feature Evaluation. R package version 1.56.0, https://CRAN.R-project.org/package=CORElearn.
See Also
Examples
# Load data
data <- tidyfit::Factor_Industry_Returns
data <- dplyr::filter(data, Industry == "HiTec")
data <- dplyr::select(data, -Date, -Industry)
# Stand-alone function
fit <- m("relief", Return ~ ., data)
coef(fit)
# Within 'regress' function
fit <- regress(data, Return ~ ., m("relief"))
coef(fit)