A program to recognize and reward our most engaged community members
Marco Boeck wrote:Hi,please be more specific. I have absolutely no clue what you want to achieve.But for starters, I'll just post a link that might be interesting to you ...Regards,Marco
MemoryExampleTable table = new MemoryExampleTable(copiedListOfAttributes);double[] doubleArray = null;[...]for (int j=0; j<copiedListOfAttributes.size(); j++) { Attribute a = copiedListOfAttributes.get(j); value = rowList.get(j); // if numerical attribute if (a.isNumerical()) { // put it into the array if (value == null) { doubleArray = Double.NaN; } else { doubleArray = Double.parseDouble(value); } // non-numerical attribute } else { // special case: date attribute if (Ontology.ATTRIBUTE_VALUE_TYPE.isA(a.getValueType(), Ontology.DATE ) || Ontology.ATTRIBUTE_VALUE_TYPE.isA(a.getValueType(), Ontology.DATE_TIME) || Ontology.ATTRIBUTE_VALUE_TYPE.isA(a.getValueType(), Ontology.TIME)) { if (value == null) { doubleArray = Double.NaN; } else { doubleArray = Double.parseDouble(value); } } else { // create a new mapping (cleared earlier) if needed, add resulting index to array if (value == null) { doubleArray = Double.NaN; } else { doubleArray = a.getMapping().mapString(rowList.get(j)); } } }}[...]// add the double array for each row to the ExampleSettable.addDataRow(new DoubleArrayDataRow(doubleArray));// create example setExampleSet exSet = table.createExampleSet();