0

is there anybody can tell me how to define the formula in the rweka?

A<- InfoGainAttributeEval(formula ~ . , data = TrainDataLSVT,na.action=NULL )

there are 310 features in the TrainDataLSVT.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
Ellen
  • 1
  • 3

1 Answers1

0

Since you do not provide your data, I will illustrate with the built-in iris data (see ?iris). For this data, the goal is to predict the Species as a function of the other variables. You can express that as a formula for InfoGainAttributeEval like this:

InfoGainAttributeEval(Species ~ ., data=iris)
Sepal.Length  Sepal.Width Petal.Length  Petal.Width 
   0.6982615    0.3855963    1.4180030    1.3784027

The values returned are the scores for each variable. The key part is the formula Species ~ . You should read this as "Species as a function of all other variables". Details on how to write a formula are available on the help page ?formula.

G5W
  • 36,531
  • 10
  • 47
  • 80