Package fr.lip6.jkernelmachines.classifier.transductive

Examples of fr.lip6.jkernelmachines.classifier.transductive.S3VMLightPegasos.valueOf()


      int nbErr = 0;
      int tpegErr = 0;
      for(TrainingSample<double[]> t : test)
      {
        int y = t.label;
        double value = peg.valueOf(t.sample);
        if(y*value < 0)
          nbErr++;
        double pegVal = tpeg.valueOf(t.sample);
        if(y*pegVal < 0)
        {
View Full Code Here


      {
        int y = t.label;
        double value = peg.valueOf(t.sample);
        if(y*value < 0)
          nbErr++;
        double pegVal = tpeg.valueOf(t.sample);
        if(y*pegVal < 0)
        {
          tpegErr++;
//          System.out.println("y : "+y+" value : "+value+" nbErr : "+nbErr+" pegVal : "+pegVal+" pegErr : "+tpegErr);
        }
View Full Code Here

    // 6. test svm
    for (double[] t : test) {
      double value = svm.valueOf(t);
      double pvalue = parzen.valueOf(t);
      double dvalue = sdca.valueOf(t);
      double gvalue = gmm.valueOf(t);
      double mvalue = mkl.valueOf(t);

      System.out.println("smo: " + value + ", parzen: "
          + pvalue + ", sdca: " + dvalue + " , gmm: "
          + gvalue + " , mkl: " + mvalue);
View Full Code Here

  public final void testTrainListOfdouble() {
    DoubleGaussianMixtureModel gmm = new DoubleGaussianMixtureModel(2);
    gmm.train(train);
   
    for(double[] x : train) {
      assertTrue(gmm.valueOf(x) > 0);
      assertTrue(gmm.valueOf(x) <= 1);
    }
  }

}
View Full Code Here

    DoubleGaussianMixtureModel gmm = new DoubleGaussianMixtureModel(2);
    gmm.train(train);
   
    for(double[] x : train) {
      assertTrue(gmm.valueOf(x) > 0);
      assertTrue(gmm.valueOf(x) <= 1);
    }
  }

}
View Full Code Here

    CustomTrainTestMatrixKernel kernel = new CustomTrainTestMatrixKernel(train, test);
   
    // assert values from train to end of test
    for(int i = 0 ; i < 5 ; i++) {
      for(int j = 0 ; j < 15 ; j++) {
        assertEquals(matrix[i][j], kernel.valueOf(i, j), 1e-15);
        assertEquals(matrix[j][i], kernel.valueOf(j, i), 1e-15);
      }
    }
   
  }
View Full Code Here

   
    // assert values from train to end of test
    for(int i = 0 ; i < 5 ; i++) {
      for(int j = 0 ; j < 15 ; j++) {
        assertEquals(matrix[i][j], kernel.valueOf(i, j), 1e-15);
        assertEquals(matrix[j][i], kernel.valueOf(j, i), 1e-15);
      }
    }
   
  }
View Full Code Here

      return;
    DoubleLinear linear = new DoubleLinear();
   
    for(TrainingSample<double[]> t : list) {
      double[] desc = t.sample;
      double norm = Math.sqrt(linear.valueOf(desc, desc));
      for(int x = 0 ; x < desc.length ; x++)
        desc[x] /= norm;
    }
   
  }
View Full Code Here

    if(list.isEmpty())
      return;
    DoubleLinear linear = new DoubleLinear();
   
    for(double[] desc : list) {
      double norm = Math.sqrt(linear.valueOf(desc, desc));
      for(int x = 0 ; x < desc.length ; x++)
        desc[x] /= norm;
    }
   
  }
View Full Code Here

      //7.1 compute w for pegasos
      double w[] = peg.getW();
      System.out.println("peg : w : "+Arrays.toString(w));
      System.out.println("peg : bias : "+peg.getB());
      System.out.println("peg : ||w|| : "+k.valueOf(w, w));

      //7.2 w from transductive pegasos
      System.out.println("tpeg : w : "+Arrays.toString(tpeg.getW()));
      System.out.println("tpeg : bias : "+tpeg.getB());
      System.out.println("tpeg : ||w|| : "+k.valueOf(tpeg.getW(), tpeg.getW()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.