//System.out.println ("list0 add "+instance.getUri()+" weight="+ilist.getInstanceWeight(i));
public void split (FeatureSelection fs)
		{
			if (ilist == null)
				throw new IllegalStateException ("Frozen.  Cannot split.");
			InstanceList ilist0 = new InstanceList (ilist.getPipe());
			InstanceList ilist1 = new InstanceList (ilist.getPipe());
			for (int i = 0; i < ilist.size(); i++) {
				Instance instance = ilist.getInstance(i);
				FeatureVector fv = (FeatureVector) instance.getData ();
				// xxx What test should this be?  What to do with negative values?
					// Whatever is decided here should also go in InfoGain.calcInfoGains()
				if (fv.value (featureIndex) != 0) {
					//System.out.println ("list1 add "+instance.getUri()+" weight="+ilist.getInstanceWeight(i));
					ilist1.add (instance, ilist.getInstanceWeight(i));
				} else {
					//System.out.println ("list0 add "+instance.getUri()+" weight="+ilist.getInstanceWeight(i));
					ilist0.add (instance, ilist.getInstanceWeight(i));
				}
			}
			logger.info("child0="+ilist0.size()+" child1="+ilist1.size());
			child0 = new Node (ilist0, this, fs);
			child1 = new Node (ilist1, this, fs);
		}
ilist1.add (instance, ilist.getInstanceWeight(i));
} else {
//System.out.println ("list0 add "+instance.getUri()+" weight="+ilist.getInstanceWeight(i));
ilist0.add (instance, ilist.getInstanceWeight(i));
}
InstanceList ilist1 = new InstanceList (ilist.getPipe());
for (int i = 0; i < ilist.size(); i++) {
Instance instance = ilist.getInstance(i);
FeatureVector fv = (FeatureVector) instance.getData ();
// xxx What test should this be? What to do with negative values?
// Whatever is decided here should also go in InfoGain.calcInfoGains()
if (fv.value (featureIndex) != 0) {
//System.out.println ("list1 add "+instance.getUri()+" weight="+ilist.getInstanceWeight(i));
ilist1.add (instance, ilist.getInstanceWeight(i));
} else {
//System.out.println ("list0 add "+instance.getUri()+" weight="+ilist.getInstanceWeight(i));
ilist0.add (instance, ilist.getInstanceWeight(i));
}
}
logger.info("child0="+ilist0.size()+" child1="+ilist1.size());
child0 = new Node (ilist0, this, fs);
child1 = new Node (ilist1, this, fs);
}
public void split (FeatureSelection fs)
{
if (ilist == null)
throw new IllegalStateException ("Frozen. Cannot split.");
InstanceList ilist0 = new InstanceList (ilist.getPipe());
InstanceList ilist1 = new InstanceList (ilist.getPipe());
for (int i = 0; i < ilist.size(); i++) {
Instance instance = ilist.getInstance(i);
FeatureVector fv = (FeatureVector) instance.getData ();
// xxx What test should this be? What to do with negative values?
// Whatever is decided here should also go in InfoGain.calcInfoGains()
if (fv.value (featureIndex) != 0) {
//System.out.println ("list1 add "+instance.getUri()+" weight="+ilist.getInstanceWeight(i));
ilist1.add (instance, ilist.getInstanceWeight(i));
} else {
//System.out.println ("list0 add "+instance.getUri()+" weight="+ilist.getInstanceWeight(i));
ilist0.add (instance, ilist.getInstanceWeight(i));
}
}
logger.info("child0="+ilist0.size()+" child1="+ilist1.size());
child0 = new Node (ilist0, this, fs);
child1 = new Node (ilist1, this, fs);
}