user2946597
user2946597

Reputation: 67

what does weka do for categorical attributes in rotation forest method?

I have a dataset which has numerical and categorical attributes. I'am doing classification by rotation forest in weka. I know that rotation forest just works in numerical attributes because it calculates PCA and other things.

My expectation is weka ignore categorical attribute but performance results are different when i classify with whole dataset and when categorical attributes are removed from dataset.

What does weka do for categorical attribute in rotation forest method?

Upvotes: -1

Views: 2512

Answers (3)

Rebecca Morgan
Rebecca Morgan

Reputation: 41

Rotation forests are similar to random forests and can be used with categorical data. They use an ensemble of base classifiers which are trained on subsets of the feature space. In Weka, the default base classifier is the J48 decision tree, which can handle categorical data, however, you can use just about any base classifier. The feature subsets are obtained using bootstrap sampling of the feature space combined with PCA. PCA is not used to reduce dimensionality in this case, it is used to select optimal rotation axes for the feature space and the dimensions are not reduced, so the usual problems with PCA and categorical data don't really apply in this case. Weka also allows you to change the principal filter from PCA, so you can apply other methods to select the optimal rotation axis which might be more suitable for nominal data.

Upvotes: 1

knb
knb

Reputation: 9313

What does weka do for categorical attribute in rotation forest method?

I don't know.

However, what about converting your attribites explicitly?

In Weka, "Categorical Attributes" are called "Nominal Attributes".

In the Preprocess Panel, you can apply several alternative filters to accomplish your task.

Apply an Unsupervised Attribute Filter "NominalToBinary", and see how it changes the attributes (creates columns with binary dummy variables).

Alternatively you can apply the Supervised Attribute Filter "NominalToBinary" which transforms the attributes in a slightly different way (check it out).

Another alternative would be to try the Unsupervised Attribute Filter "MakeIndicator" (converts to numeric, but lumps together all categories to 0, except for one which encodes as numeric 1 ) .

Which alternatives to choose? That depends on your requirements.

Upvotes: 1

If your categorical attribute is categorized to numbers, Weka will treat them as numerical attribute.

Upvotes: 0

Related Questions