ExcelExampleSource unable to label data

e4gle
e4gle New Altair Community Member
edited November 5 in Community Q&A
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?

Tagged:

Answers

  • land
    land New Altair Community Member
    Well,
    probably, because there's no such parameter in the operator?

    Greetings,
      Sebastian
  • e4gle
    e4gle New Altair Community Member
    Apparently, but what is
    ExcelExampleSource.PARAMETER_LABEL_COLUMN 
    ?

    So how to load labeled data from an excel sheet?
  • e4gle
    e4gle New Altair Community Member
    So how to load labeled data from an excel sheet?
    Bump, really want to know what is the answer for that question.
  • land
    land New Altair Community Member
    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
  • e4gle
    e4gle New Altair Community Member
    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.
  • land
    land New Altair Community Member
    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
  • e4gle
    e4gle New Altair Community Member
    That helped a lot, thanks :)