コード例 #1
0
 /**
  * Test method for {@link net.jkernelmachines.classifier.DoublePegasosSVM#train(java.util.List)}.
  */
 @Test
 public final void testTrainListOfTrainingSampleOfdouble() {
   svm.train(train);
   for (TrainingSample<double[]> t : train) {
     double v = t.label * svm.valueOf(t.sample);
     assertTrue(v > 0);
   }
 }
コード例 #2
0
  /**
   * Test method for {@link net.jkernelmachines.classifier.DoublePegasosSVM#train(java.util.List)}.
   */
  @Test
  public final void testOnlineTrainTrainingSampleStreamOfdouble() {
    svm.onlineTrain(new ListSampleStream<double[]>(train));

    for (TrainingSample<double[]> t : train) {
      double v = t.label * svm.valueOf(t.sample);
      assertTrue(v > 0);
    }
  }
コード例 #3
0
 /**
  * Test method for {@link
  * net.jkernelmachines.classifier.DoublePegasosSVM#train(fr.lip6.jkernelmachines.TrainingSample)}.
  */
 @Test
 public final void testTrainOfTrainingSampleOfdouble() {
   svm = new DoublePegasosSVM();
   for (TrainingSample<double[]> t : train) {
     svm.train(t);
   }
   for (TrainingSample<double[]> t : train) {
     double v = t.label * svm.valueOf(t.sample);
     assertTrue(v > 0);
   }
 }