A program to recognize and reward our most engaged community members
List<Attribute> listOfAttributes;listOfAttributes.add(AttributeFactory.createAttribute("helloWorldAttribute", Ontology.NUMERICAL);// setup your attribute listMemoryExampleTable table = new MemoryExampleTable(listOfAttributes);// setup your data rowsdouble[] doubleArray = new double[] { 1.0d, 2.0d, 3.0d };table.addDataRow(new DoubleArrayDataRow(doubleArray));ExampleSet exSet = table.createExampleSet();// if you need special roles:Attribute att = listOfAttributes.get(0);exSet.getAttributes().setSpecialAttribute(att, "label");
If you however want to dig deeper, you may have to check how RapidMiner uses the code to avoid a trap or two.
Marco Boeck wrote:Hi,the RapidMiner code grew over the past decade or so, and of course there are a few flaws in it as in any other code. I guess we have to deal with it for now As the main focus of RapidMiner is not to serve as a library (although it can) but to provide a well working data mining platform, there is no time for a code rewrite in the near future. But you never know what the future may bring But it's quite easy to create an exampleSet to use. List<Attribute> listOfAttributes;listOfAttributes.add(AttributeFactory.createAttribute("helloWorldAttribute", Ontology.NUMERICAL);// setup your attribute listMemoryExampleTable table = new MemoryExampleTable(listOfAttributes);// setup your data rowsdouble[] doubleArray = new double[] { 1.0d, 2.0d, 3.0d };table.addDataRow(new DoubleArrayDataRow(doubleArray));ExampleSet exSet = table.createExampleSet();// if you need special roles:Attribute att = listOfAttributes.get(0);exSet.getAttributes().setSpecialAttribute(att, "label"); If you however want to dig deeper, you may have to check how RapidMiner uses the code to avoid a trap or two.Regards,Marco