ExcelExampleSource unable to label data

e4glee4gle Member Posts: 12 Contributor II
edited November 2018 in Help
As in topic. Here is the code:
ExcelExampleSource trainingData = OperatorService
.createOperator(ExcelExampleSource.class);
trainingData.setParameter("excel_file", "audis_trainingData.xls");
trainingData.setParameter("create_label", "true");
trainingData.setParameter("label_column", "5");
I try to apply this data to a model, but:
com.rapidminer.operator.UserError: Input example set does not have a label attribute
How come?

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Well,
    probably, because there's no such parameter in the operator?

    Greetings,
      Sebastian
  • e4glee4gle Member Posts: 12 Contributor II
    Apparently, but what is
    ExcelExampleSource.PARAMETER_LABEL_COLUMN 
    ?

    So how to load labeled data from an excel sheet?
  • e4glee4gle Member Posts: 12 Contributor II
    So how to load labeled data from an excel sheet?
    Bump, really want to know what is the answer for that question.
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi,
    either use the configuration wizard or just load the data and insert another operator "set role" after this to identify the label attribute.

    Greetings,
      Sebastian
  • e4glee4gle Member Posts: 12 Contributor II
    I thought of that before, but i simply can't find this operator. I know of it's presence in the actual RapidMiner program, but i can't find it in javadoc.
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi,
    because of historical reasons, the class names of the operators are not equivalent to the names inside the program. So if the operator  is called "Set Role" one would assume the class would be called "SetRoleOperator" and I really would like that, but unfortunately it is called "ChangeAttributeRole". If you want to match an operators name to a class, take a look in the OperatorsCore.xml in the resource directory of RapidMiner. There the matching is done.

    Greetings,
      Sebastian
  • e4glee4gle Member Posts: 12 Contributor II
    That helped a lot, thanks :)
Sign In or Register to comment.