Add a data row of both strings and doubles

spoispoi Member Posts: 3 Contributor I
edited November 2018 in Help
Hi all,

I need a little bit help to access rapid miner into my application. I stored my data like a columnstore, so each column has an own format (string, double, int).

It this possible to add instead of a double data row to add a row with different formats in each column?

Here is my code:


RapidMiner.init();
Process process = new Process(pathtoProcessXML);

    // create attribute list
List<Attribute> attributes = new LinkedList<Attribute>();
attributes.add(AttributeFactory.createAttribute("att1", Ontology.INTEGER));
Attribute lable = AttributeFactory.createAttribute("label", Ontology.NOMINAL);
lable.getMapping().mapString("0");
lable.getMapping().mapString("1");
attributes.add(lable);

    // create table content
MemoryExampleTable table = new MemoryExampleTable(attributes);

double[] data = new double[2];
data[0] = 0;
data[1] = 0;
table.addDataRow(new DoubleArrayDataRow(data));

    // create example set
    ExampleSet exampleSet = table.createExampleSet(lable);
   
    // Print table
    for (int row = 0; row < table.size(); row++) {
    System.out.println(table.getDataRow(row));
}
   
    System.out.println(exampleSet.toResultString());

    // run the process with new IOContainer using the created exampleSet  
    process.run(new IOContainer(exampleSet));
Gives the rapid miner library a possibility to add different column types?

Thanks a lot for answering!
Tagged:

Answers

  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    internally everything is stored as a double, there is no mixed row. So when looking at a data row you need to also look at the attribute to find out what exactly to do with the data.
    Please also be aware that since you are integrating RapidMiner into your application and RapidMiner uses the AGPL 3 license, your application must also be released under AGPL 3. If that is not possible/desirable, please contact us for a RapidMiner OEM license.

    Regards,
    Marco
Sign In or Register to comment.