chi.squared: Chi-squared filter

Description Usage Arguments Details Value Author(s) Examples

Description

The algorithm finds weights of discrete attributes basing on a chi-squared test.

Usage

1

Arguments

formula

a symbolic description of a model

data

a symbolic description of a model

Details

The result is equal to Cramer's V coefficient between source attributes and destination attribute.

Value

a data.frame containing the worth of attributes in the first column and their names as row names

Author(s)

Piotr Romanski

Examples

1
2
3
4
5
6
7
8
  library(mlbench)
  data(HouseVotes84)

  weights <- chi.squared(Class~., HouseVotes84)
  print(weights)
  subset <- cutoff.k(weights, 5)
  f <- as.simple.formula(subset, "Class")
  print(f)

Example output

OpenJDK 64-Bit Server VM warning: Can't detect initial thread stack location - find_vma failed
    attr_importance
V1      0.409330348
V2      0.004534049
V3      0.748864321
V4      0.923255954
V5      0.718768923
V6      0.428332508
V7      0.521967369
V8      0.661876085
V9      0.629797943
V10     0.083809300
V11     0.378240781
V12     0.714922593
V13     0.555971176
V14     0.625283342
V15     0.538263037
V16     0.353273580
Class ~ V4 + V3 + V5 + V12 + V8
<environment: 0x35af8d0>

FSelector documentation built on May 2, 2019, 4:52 p.m.