Commit 2aa07ec0 authored by Simon Trapp's avatar Simon Trapp

performance improvement for WEKA

parent 0d8574cb
......@@ -53,6 +53,7 @@ public class WEKA implements AbstractDistribution {
Classifier wekaModel;
Instances dataStructure = null;
Instance dataPoint;
public WEKA(Classifier model) {
if (model == null)
......@@ -67,9 +68,6 @@ public class WEKA implements AbstractDistribution {
if (dataStructure == null)
initializeDataStructure(tokenNumbers.length);
Instance dataPoint = new DenseInstance(dataStructure.numAttributes());
dataPoint.setDataset(dataStructure);
for (int i = 0; i < tokenNumbers.length; i++) {
dataPoint.setValue(i + 1, tokenNumbers[i]);
}
......@@ -101,6 +99,9 @@ public class WEKA implements AbstractDistribution {
}
dataStructure = new Instances("Data Structure", attributes, 0);
dataStructure.setClass(attr_RT);
dataPoint = new DenseInstance(dataStructure.numAttributes());
dataPoint.setDataset(dataStructure);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment