Learn R Programming

FSelector (version 0.34)

chi.squared: Chi-squared filter

Description

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

Usage

chi.squared(formula, data)

Value

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

Arguments

formula

a symbolic description of a model

data

a symbolic description of a model

Author

Piotr Romanski

Details

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

Examples

Run this code
  library(mlbench)
  data(HouseVotes84)

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

Run the code above in your browser using DataLab