MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / run

Method run

JSAT/src/jsat/classifiers/boosting/Wagging.java:220–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 10

trainMethod · 0.95
countDownMethod · 0.80
cloneMethod · 0.65
trainCMethod · 0.65
getSampleSizeMethod · 0.45
maxMethod · 0.45
invCdfMethod · 0.45
nextDoubleMethod · 0.45
setWeightMethod · 0.45
getDataPointMethod · 0.45

Tested by

no test coverage detected