- Timestamp:
- 10/16/14 10:37:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/training/WekaClusterTraining2.java
r2 r19 67 67 private EM clusterer = null; 68 68 69 private HashMap<Integer, Classifier> cclassifier = new HashMap<Integer, Classifier>();70 private HashMap<Integer, Instances> ctraindata = new HashMap<Integer, Instances>();69 private HashMap<Integer, Classifier> cclassifier; 70 private HashMap<Integer, Instances> ctraindata; 71 71 72 72 … … 115 115 int cnum = clusterer.clusterInstance(clusterInstance); 116 116 117 //Console.traceln(Level.INFO, String.format("instance is in cluster: " + cnum)); 118 117 119 // 2. classify testata instance to the classifier 118 120 ret = cclassifier.get(cnum).classifyInstance(classInstance); … … 141 143 // 3. cluster data 142 144 //Console.traceln(Level.INFO, String.format("starting clustering")); 145 146 cclassifier = new HashMap<Integer, Classifier>(); 147 ctraindata = new HashMap<Integer, Instances>(); 143 148 144 149 // use standard params for now … … 173 178 } 174 179 180 // Debug output 181 //Console.traceln(Level.INFO, String.format("number of clusters: " + clusterer.numberOfClusters())); 182 175 183 // train one classifier per cluster, we get the clusternumber from the traindata 176 184 Iterator<Integer> clusternumber = ctraindata.keySet().iterator(); … … 180 188 cclassifier.get(cnumber).buildClassifier(ctraindata.get(cnumber)); 181 189 182 //Console.traceln(Level.INFO, String.format(" classifier in cluster "+cnumber));190 //Console.traceln(Level.INFO, String.format("building classifier in cluster "+cnumber + " with " + ctraindata.get(cnumber).size() + " traindata instances")); 183 191 } 184 192 }
Note: See TracChangeset
for help on using the changeset viewer.