relief {FSelector} | R Documentation |
The algorithm finds weights of continous and discrete attributes basing on a distance between instances.
relief(formula, data, neighbours.count = 5, sample.size = 10)
formula |
a symbolic description of a model |
data |
data to process |
neighbours.count |
number of neighbours to find for every sampled instance |
sample.size |
number of instances to sample |
The algorithm samples instances and finds their nearest hits and misses. Considering that result, it evaluates weights of attributes.
a data.frame containing the worth of attributes in the first column and their names as row names
Piotr Romanski
data(iris) weights <- relief(Species~., iris, neighbours.count = 5, sample.size = 20) print(weights) subset <- cutoff.k(weights, 2) f <- as.simple.formula(subset, "Species") print(f)