@Test public void testSameLabelsOutput() { MultiLayerNetwork network = new MultiLayerNetwork(getNetworkConf(40)); network.init(); network.setListeners(new ScoreIterationListener(1)); network.fit(reshapeInput(data), data); Evaluation ev = eval(network); Assert.assertTrue(ev.f1() > 0.90); }
/** * Returns the f1 score for the given examples. Think of this to be like a percentage right. The * higher the number the more it got right. This is on a scale from 0 to 1. * * @param examples te the examples to classify (one example in each row) * @param labels the true labels * @return the scores for each ndarray */ public double f1Score(INDArray examples, INDArray labels) { Evaluation eval = new Evaluation(); eval.eval(labels, labelProbabilities(examples)); return eval.f1(); }