From: Sunsern C. <sch...@us...> - 2009-06-08 23:40:58
|
Update of /cvsroot/jboost/jboost/src/jboost/learner In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11232/src/jboost/learner Modified Files: Tag: jboost-2_0 EqualitySplitterBuilder.java InequalitySplitter.java InequalitySplitterBuilder.java SetSplitterBuilder.java StumpSplitterBuilderFamily.java Log Message: jboost 2.0 Index: StumpSplitterBuilderFamily.java =================================================================== RCS file: /cvsroot/jboost/jboost/src/jboost/learner/StumpSplitterBuilderFamily.java,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** StumpSplitterBuilderFamily.java 24 Jan 2008 22:48:54 -0000 1.2 --- StumpSplitterBuilderFamily.java 8 Jun 2009 23:40:49 -0000 1.2.4.1 *************** *** 2,13 **** import java.util.Vector; import jboost.booster.Booster; import jboost.controller.Configuration; import jboost.examples.AttributeDescription; import jboost.examples.DiscreteAttribute; import jboost.examples.ExampleDescription; import jboost.examples.RealAttribute; import jboost.examples.SetAttribute; - import jboost.examples.*; import jboost.monitor.Monitor; --- 2,15 ---- import java.util.Vector; + import jboost.booster.Booster; import jboost.controller.Configuration; import jboost.examples.AttributeDescription; + import jboost.examples.BooleanAttribute; import jboost.examples.DiscreteAttribute; import jboost.examples.ExampleDescription; + import jboost.examples.IntegerAttribute; import jboost.examples.RealAttribute; import jboost.examples.SetAttribute; import jboost.monitor.Monitor; Index: SetSplitterBuilder.java =================================================================== RCS file: /cvsroot/jboost/jboost/src/jboost/learner/SetSplitterBuilder.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** SetSplitterBuilder.java 16 May 2007 04:06:02 -0000 1.1.1.1 --- SetSplitterBuilder.java 8 Jun 2009 23:40:49 -0000 1.1.1.1.4.1 *************** *** 5,19 **** import jboost.CandidateSplit; import jboost.NotSupportedException; - import jboost.booster.Bag; import jboost.booster.AbstractBooster; import jboost.booster.Booster; import jboost.examples.Attribute; import jboost.examples.AttributeDescription; - import jboost.examples.DiscreteAttribute; import jboost.examples.Example; - import jboost.examples.Label; import jboost.examples.SetAttribute; import jboost.examples.WordTable; - import jboost.monitor.Monitor; /** --- 5,16 ---- import jboost.CandidateSplit; import jboost.NotSupportedException; import jboost.booster.AbstractBooster; + import jboost.booster.Bag; import jboost.booster.Booster; import jboost.examples.Attribute; import jboost.examples.AttributeDescription; import jboost.examples.Example; import jboost.examples.SetAttribute; import jboost.examples.WordTable; /** Index: EqualitySplitterBuilder.java =================================================================== RCS file: /cvsroot/jboost/jboost/src/jboost/learner/EqualitySplitterBuilder.java,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** EqualitySplitterBuilder.java 7 Apr 2008 16:29:27 -0000 1.2 --- EqualitySplitterBuilder.java 8 Jun 2009 23:40:49 -0000 1.2.4.1 *************** *** 4,12 **** import java.util.Vector; - //import sun.tools.tree.CastExpression; - import jboost.CandidateSplit; import jboost.booster.Bag; - import jboost.booster.AbstractBooster; import jboost.booster.Booster; import jboost.examples.Attribute; --- 4,9 ---- *************** *** 14,22 **** import jboost.examples.DiscreteAttribute; import jboost.examples.Example; - import jboost.examples.ExampleDescription; - import jboost.examples.Label; - import jboost.monitor.Monitor; - import jboost.tokenizer.DataStream; - import jboost.tokenizer.jboost_DataStream; /** --- 11,14 ---- Index: InequalitySplitter.java =================================================================== RCS file: /cvsroot/jboost/jboost/src/jboost/learner/InequalitySplitter.java,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** InequalitySplitter.java 24 Jan 2008 22:48:54 -0000 1.2 --- InequalitySplitter.java 8 Jun 2009 23:40:49 -0000 1.2.4.1 *************** *** 4,9 **** import jboost.examples.AttributeDescription; import jboost.examples.Instance; import jboost.examples.RealAttribute; - import jboost.examples.*; /** --- 4,9 ---- import jboost.examples.AttributeDescription; import jboost.examples.Instance; + import jboost.examples.IntegerAttribute; import jboost.examples.RealAttribute; /** Index: InequalitySplitterBuilder.java =================================================================== RCS file: /cvsroot/jboost/jboost/src/jboost/learner/InequalitySplitterBuilder.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** InequalitySplitterBuilder.java 17 Nov 2008 22:31:13 -0000 1.4 --- InequalitySplitterBuilder.java 8 Jun 2009 23:40:49 -0000 1.4.2.1 *************** *** 3,6 **** --- 3,7 ---- import java.util.Collections; import java.util.List; + import jboost.CandidateSplit; import jboost.NotSupportedException; *************** *** 9,18 **** import jboost.examples.Attribute; import jboost.examples.AttributeDescription; - import jboost.examples.DiscreteAttribute; import jboost.examples.Example; import jboost.examples.Label; - import jboost.examples.*; import jboost.examples.RealAttribute; - import jboost.monitor.Monitor; --- 10,17 ---- import jboost.examples.Attribute; import jboost.examples.AttributeDescription; import jboost.examples.Example; + import jboost.examples.IntegerAttribute; import jboost.examples.Label; import jboost.examples.RealAttribute; *************** *** 217,264 **** * @returns The partition of the data or null if the splitter is not compatible. */ public int[][] split(Splitter sp) { ! if (attributeIndex != sp.getIndex()) ! return (null); ! double threshold= ((InequalitySplitter) sp).getThreshold(); ! int[][] result= new int[2][]; ! if (sortedListOwner) { ! int cutIndex; // locate the place where the ! // list should be cut into two ! for (cutIndex= 0; cutIndex < sortedIndices.length; cutIndex++) { ! if (indexedValues[sortedIndices[cutIndex]] > threshold) ! break; ! } ! result[0]= new int[cutIndex]; // create first list ! for (int j= 0; j < cutIndex; j++) ! result[0][j]= sortedIndices[j]; ! result[1]= new int[sortedIndices.length - cutIndex]; ! // create second list ! for (int j= cutIndex; j < sortedIndices.length; j++) ! result[1][j - cutIndex]= sortedIndices[j]; ! } else { ! int[] l= new int[noOfElements]; ! // temporary storage for list of elements ! int j= 0; ! int cutIndex= -1; ! int index= 0; ! for (int i= 0; i < sortedIndices.length; i++) { ! index= sortedIndices[i]; ! if (examplesMask[index]) { ! if ((cutIndex == -1) && (indexedValues[index] > threshold)) ! cutIndex= j; ! l[j++]= index; ! } ! } ! if (cutIndex==-1) { ! System.out.println(this); ! } ! result[0]= new int[cutIndex]; // create first list ! int noGreater= j; ! result[1]= new int[noGreater - cutIndex]; // create second list ! for (j= 0; j < cutIndex; j++) ! result[0][j]= l[j]; ! for (; j < noGreater; j++) ! result[1][j - cutIndex]= l[j]; } ! return result; } --- 216,272 ---- * @returns The partition of the data or null if the splitter is not compatible. */ public int[][] split(Splitter sp) { ! if (attributeIndex != sp.getIndex()) ! return (null); ! double threshold= ((InequalitySplitter) sp).getThreshold(); ! int[][] result= new int[2][]; ! if (sortedListOwner) { ! int cutIndex; // locate the place where the ! // list should be cut into two ! for (cutIndex= 0; cutIndex < sortedIndices.length; cutIndex++) { ! if (indexedValues[sortedIndices[cutIndex]] > threshold) ! break; } ! result[0]= new int[cutIndex]; // create first list ! for (int j= 0; j < cutIndex; j++) ! result[0][j]= sortedIndices[j]; ! result[1]= new int[sortedIndices.length - cutIndex]; ! // create second list ! for (int j= cutIndex; j < sortedIndices.length; j++) ! result[1][j - cutIndex]= sortedIndices[j]; ! } else { ! int[] l= new int[noOfElements]; ! // temporary storage for list of elements ! int j= 0; ! int cutIndex= -1; ! int index= 0; ! for (int i= 0; i < sortedIndices.length; i++) { ! index= sortedIndices[i]; ! if (examplesMask[index]) { ! if ((cutIndex == -1) && (indexedValues[index] > threshold)) ! cutIndex= j; ! l[j++]= index; ! } ! } ! ! if (cutIndex==-1) { ! System.out.println(this); ! result[0] = new int[0]; ! int noGreater= j; ! result[1] = new int[noGreater]; ! for (j=0;j<noGreater;j++) { ! result[1][j] = l[j]; ! } ! } ! else { ! result[0]= new int[cutIndex]; // create first list ! int noGreater= j; ! result[1]= new int[noGreater - cutIndex]; // create second list ! for (j= 0; j < cutIndex; j++) ! result[0][j]= l[j]; ! for (; j < noGreater; j++) ! result[1][j - cutIndex]= l[j]; ! } ! } ! return result; } |