correlation: Correlation filter

Description Usage Arguments Details Value Author(s) Examples

Description

The algorithm finds weights of continous attributes basing on their correlation with continous class attribute.

Usage

1
2

Arguments

formula

a symbolic description of a model

data

data to process

Details

linear.correlation uses Pearson's correlation

rank.correlation uses Spearman's correlation

Rows with NA values are not taken into consideration.

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
 9
10
11
12
13
14
15
  library(mlbench)
  data(BostonHousing)
  d=BostonHousing[-4] # only numeric variables
  
  weights <- linear.correlation(medv~., d)
  print(weights)
  subset <- cutoff.k(weights, 3)
  f <- as.simple.formula(subset, "medv")
  print(f)

  weights <- rank.correlation(medv~., d)
  print(weights)
  subset <- cutoff.k(weights, 3)
  f <- as.simple.formula(subset, "medv")
  print(f)

Example output

OpenJDK 64-Bit Server VM warning: Can't detect initial thread stack location - find_vma failed
        attr_importance
crim          0.3883046
zn            0.3604453
indus         0.4837252
nox           0.4273208
rm            0.6953599
age           0.3769546
dis           0.2499287
rad           0.3816262
tax           0.4685359
ptratio       0.5077867
b             0.3334608
lstat         0.7376627
medv ~ lstat + rm + ptratio
<environment: 0x3aa2ec0>
        attr_importance
crim          0.5588909
zn            0.4381790
indus         0.5782554
nox           0.5626088
rm            0.6335764
age           0.5475617
dis           0.4458569
rad           0.3467763
tax           0.5624106
ptratio       0.5559047
b             0.1856641
lstat         0.8529141
medv ~ lstat + rm + indus
<environment: 0x4234698>
Warning message:
system call failed: Cannot allocate memory 

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