/** * Trains this classifier incrementally using the given instance. * * @param inst the instance to be used for training */ @Override public void trainOnInstance(Instance inst) { if (this.isInit == false) { this.isInit = true; InstancesHeader instances = new InstancesHeader(dataset); this.learner.setModelContext(instances); this.learner.prepareForUse(); } if (inst.weight() > 0) { inst.setDataset(dataset); learner.trainOnInstance(inst); } }