WEKA API - Categorize instances into a binary bin based on attribute value

Viewed 34

For my research in data mining, I wish split an instances object based on the value of a continuous attribute.

Say I have the following arff:

Att1, Att2, Att3, ClassValue
1,    2,    3,    class0
9,    3,    6,    class1
7,    9,    0,    class 0

I want to use the value 7 in Att1 as the splitting point. So any values less than 7 goes into one instances object and any values above 7 goes into a different instances object. Are there built-in methods that do this or at least facilitate this process in Weka?

Thanks in advance.

1 Answers

You could use the SubsetByExpression filter for generating the two subsets of your data. Run the filter twice on the data using the following expressions:

  • (ATT1 < 7)
  • (ATT1 >= 7)
Related