List of usage examples for weka.core Instances Instances
public Instances(Instances dataset)
From source file:edu.umbc.cs.maple.utils.WekaUtils.java
License:Open Source License
/** Merge two instance sets. * @param instances1//from w w w.j av a 2 s . c om * @param instances2 * @return the merged instance sets */ public static Instances mergeInstances(Instances instances1, Instances instances2) { if (instances1 == null) return instances2; if (instances2 == null) return instances1; if (!instances1.checkInstance(instances2.firstInstance())) throw new IllegalArgumentException("The instance sets are incompatible."); Instances mergedInstances = new Instances(instances1); Instances tempInstances = new Instances(instances2); for (int i = 0; i < tempInstances.numInstances(); i++) { mergedInstances.add(tempInstances.instance(i)); } return mergedInstances; }