()
| 218 | } |
| 219 | |
| 220 | @Override |
| 221 | public void run() |
| 222 | { |
| 223 | if (ds instanceof ClassificationDataSet) |
| 224 | { |
| 225 | ClassificationDataSet cds = (ClassificationDataSet) ds; |
| 226 | for (int i = start; i < end; i++) |
| 227 | { |
| 228 | for (int j = 0; j < ds.getSampleSize(); j++) |
| 229 | { |
| 230 | double newWeight = Math.max(1e-6, dist.invCdf(rand.nextDouble())); |
| 231 | ds.getDataPoint(j).setWeight(newWeight); |
| 232 | } |
| 233 | Classifier hypot = weakL.clone(); |
| 234 | hypot.trainC(cds); |
| 235 | hypotsL[i] = hypot; |
| 236 | } |
| 237 | } |
| 238 | else if(ds instanceof RegressionDataSet) |
| 239 | { |
| 240 | RegressionDataSet rds = (RegressionDataSet) ds; |
| 241 | for (int i = start; i < end; i++) |
| 242 | { |
| 243 | for (int j = 0; j < ds.getSampleSize(); j++) |
| 244 | ds.getDataPoint(i).setWeight(Math.max(1e-6, dist.invCdf(rand.nextDouble()))); |
| 245 | Regressor hypot = weakR.clone(); |
| 246 | hypot.train(rds); |
| 247 | hypotsR[i] = hypot; |
| 248 | } |
| 249 | } |
| 250 | else |
| 251 | throw new RuntimeException("BUG: please report"); |
| 252 | |
| 253 | latch.countDown(); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | private void performTraining(ExecutorService threadPool, DataSet dataSet) |
nothing calls this directly
no test coverage detected