The algorithm finds weights of continuous and discrete attributes basing on a distance between instances.
relief(formula, data, x, y, neighboursCount = 5, sampleSize = 10)
An object of class formula with model description.
A data.frame accompanying formula.
A data.frame with attributes.
A vector with response variable.
number of neighbours to find for every sampled instance
number of instances to sample
a data.frame containing the worth of attributes in the first column and their names as row names
The function and it's manual page taken directly from FSelector: Piotr Romanski and Lars Kotthoff (2018). FSelector: Selecting Attributes. R package version 0.31. https://CRAN.R-project.org/package=FSelector
Igor Kononenko: Estimating Attributes: Analysis and Extensions of RELIEF. In: European Conference on Machine Learning, 171-182, 1994.
Marko Robnik-Sikonja, Igor Kononenko: An adaptation of Relief for attribute estimation in regression. In: Fourteenth International Conference on Machine Learning, 296-304, 1997.
data(iris)
weights <- relief(Species~., iris, neighboursCount = 5, sampleSize = 20)
print(weights)
#> attributes importance
#> 1 Sepal.Length 0.1413889
#> 2 Sepal.Width 0.1095833
#> 3 Petal.Length 0.3222034
#> 4 Petal.Width 0.3585417
subset <- cut_attrs(weights, 2)
f <- to_formula(subset, "Species")
print(f)
#> Species ~ Petal.Width + Petal.Length
#> <environment: 0x55b2459adcb0>