8

I want to apply a decision tree learning algorithm to a dataset I have imported from a CSV. The problem is that the "tra" input of the Decision Tree block is still red, stating "Input example set must have special attribute 'label'.". How do I add that label? What is it? I have been playing around with it for some time without results. Any help appreciated.

ADDENDUM: the column's titles have been correctly inferred, so I have no clue on what the 'label' is.

fstab
  • 4,801
  • 8
  • 34
  • 66

2 Answers2

13

When you import data in RapidMiner, In Step number 4, you need to select the attribute type "label" for the column you wish to classify.

Labelling the classifier column as with "label" attribute

Click Next button in the bottom.

In Step 5, it will ask you to save the import file, Choose any suitable name and click 'Finish'.

Mayank Agarwal
  • 885
  • 1
  • 9
  • 7
  • Thanks for your answer. What you suggest is correct, but I actually found more useful Josef Borkovec's answer since it applies to any stage of the computation, and is not limited to the data importation. – fstab Jan 28 '14 at 12:41
12

Label is the attribute that represents the target class for classification. "Set Role" operator can set an attribute as label, but you can do that when importing the data - most import operators can be configured to set the role of attributes. "Read CSV" is one of them.

Josef Borkovec
  • 1,069
  • 8
  • 13