MCPcopy Create free account
hub / github.com/WinVector/Logistic / run

Method run

src/com/winvector/logistic/LogisticTrain.java:323–340  ·  view source on GitHub ↗
(final Iterable<BurstMap> trainSource, final Formula f, final String weightKey,
			final File resultFileSer, final File resultFileTSV)

Source from the content-addressed store, hash-verified

321
322
323 public final void run(final Iterable<BurstMap> trainSource, final Formula f, final String weightKey,
324 final File resultFileSer, final File resultFileTSV) throws IOException, ParseException, ClassNotFoundException {
325 final Log log = LogFactory.getLog(this.getClass());
326 final Model model = train(trainSource,f,weightKey);
327 LogisticScore.score(model, trainSource, null);
328 if(resultFileSer!=null) {
329 log.info("writing " + resultFileSer.getAbsolutePath());
330 final ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(resultFileSer));
331 oos.writeObject(model);
332 oos.close();
333 }
334 if(resultFileTSV!=null) {
335 log.info("writing " + resultFileTSV.getAbsolutePath());
336 final PrintStream p = new PrintStream(new FileOutputStream(resultFileTSV));
337 p.println(model.config.formatSoln(model.coefs));
338 p.close();
339 }
340 }
341
342}

Callers 5

mainMethod · 0.95
testTrainScoreMethod · 0.45
testTestScoreMethod · 0.45
testTrainScoreMethod · 0.45
testMRScoreMethod · 0.45

Calls 3

trainMethod · 0.95
scoreMethod · 0.95
formatSolnMethod · 0.80

Tested by 4

testTrainScoreMethod · 0.36
testTestScoreMethod · 0.36
testTrainScoreMethod · 0.36
testMRScoreMethod · 0.36