- Timestamp:
- 07/18/16 12:26:03 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaBaggingTraining.java
r99 r135 29 29 30 30 /** 31 * Programmatic WekaBaggingTraining 32 * 33 * first parameter is Trainer Name. second parameter is class name 34 * 35 * all subsequent parameters are configuration params (for example for trees) Cross Validation 36 * params always come last and are prepended with -CVPARAM 37 * 31 * <p> 32 * The first parameter is the trainer name, second parameter is class name. All subsequent 33 * parameters are configuration parameters of the algorithms. Cross validation parameters always 34 * come last and are prepended with -CVPARAM 35 * </p> 36 * <p> 38 37 * XML Configurations for Weka Classifiers: 39 38 * … … 45 44 * } 46 45 * </pre> 46 * </p> 47 47 * 48 * @author Alexander Trautsch 48 49 */ 49 50 public class WekaBaggingTraining extends WekaBaseTraining implements ISetWiseTrainingStrategy { 50 51 52 /** 53 * the classifier 54 */ 51 55 private final TraindatasetBagging classifier = new TraindatasetBagging(); 52 56 57 /* 58 * (non-Javadoc) 59 * 60 * @see de.ugoe.cs.cpdp.training.WekaBaseTraining#getClassifier() 61 */ 53 62 @Override 54 63 public Classifier getClassifier() { … … 56 65 } 57 66 67 /* 68 * (non-Javadoc) 69 * 70 * @see 71 * de.ugoe.cs.cpdp.training.ISetWiseTrainingStrategy#apply(org.apache.commons.collections4.list. 72 * SetUniqueList) 73 */ 58 74 @Override 59 75 public void apply(SetUniqueList<Instances> traindataSet) { … … 66 82 } 67 83 84 /** 85 * <p> 86 * Helper class for bagging classifiers. 87 * </p> 88 * 89 * @author Steffen Herbold 90 */ 68 91 public class TraindatasetBagging extends AbstractClassifier { 69 92 93 /** 94 * default serialization ID. 95 */ 70 96 private static final long serialVersionUID = 1L; 71 97 98 /** 99 * internal storage of the training data 100 */ 72 101 private List<Instances> trainingData = null; 73 102 103 /** 104 * bagging classifier for each training data set 105 */ 74 106 private List<Classifier> classifiers = null; 75 107 108 /* 109 * (non-Javadoc) 110 * 111 * @see weka.classifiers.AbstractClassifier#classifyInstance(weka.core.Instance) 112 */ 76 113 @Override 77 114 public double classifyInstance(Instance instance) { … … 115 152 } 116 153 154 /** 155 * <p> 156 * trains a new dataset wise bagging classifier 157 * </p> 158 * 159 * @param traindataSet 160 * the training data per prodcut 161 * @throws Exception 162 * thrown if an error occurs during the training of the classifiers for any 163 * product 164 */ 117 165 public void buildClassifier(SetUniqueList<Instances> traindataSet) throws Exception { 118 166 classifiers = new LinkedList<>(); … … 126 174 } 127 175 176 /* 177 * (non-Javadoc) 178 * 179 * @see weka.classifiers.Classifier#buildClassifier(weka.core.Instances) 180 */ 128 181 @Override 129 182 public void buildClassifier(Instances traindata) throws Exception {
Note: See TracChangeset
for help on using the changeset viewer.