Package fr.lip6.jkernelmachines.kernel.extra

Examples of fr.lip6.jkernelmachines.kernel.extra.CustomTrainTestMatrixKernel


  public void setUp() throws Exception {
   
    GaussianGenerator g = new GaussianGenerator(10, 5.0f, 0.1);
    train = g.generateList(50);
   
    DoubleGaussL2 k = new DoubleGaussL2(1.0);
    svm = new LaSVM<double[]>(k);
    svm.setC(1.0);
  }
View Full Code Here


    System.out.println("Samples generated");

    // 3. train svm
    long time = System.currentTimeMillis();
    // Kernel<double[]> k = new DoubleLinear();
    DoubleGaussL2 k = new DoubleGaussL2();
    k.setGamma(2);
    SMODensity<double[]> svm = new SMODensity<double[]>(k);
    svm.setC(100);
    svm.train(train);
    long smotime = System.currentTimeMillis() - time;
    System.out.println("SMO done in " + smotime);
View Full Code Here

  public void setUp() throws Exception {
   
    GaussianGenerator g = new GaussianGenerator(10, 5.0f, 1.0);
    train = g.generateList(10);
   
    DoubleGaussL2 k = new DoubleGaussL2(1.0);
    svm = new LaSVMI<double[]>(k);
  }
View Full Code Here

  /**
   * Test method for {@link fr.lip6.jkernelmachines.classifier.LaSVMI#LaSVMI(fr.lip6.jkernelmachines.kernel.Kernel)}.
   */
  @Test
  public final void testLaSVMI() {
    DoubleGaussL2 k = new DoubleGaussL2(1.0);
    svm = new LaSVMI<double[]>(k);
    assertEquals(k, svm.getKernel());
  }
View Full Code Here

  /**
   * Test method for {@link fr.lip6.jkernelmachines.classifier.LaSVMI#setKernel(fr.lip6.jkernelmachines.kernel.Kernel)}.
   */
  @Test
  public final void testSetKernel() {
    DoubleGaussL2 k = new DoubleGaussL2();
    svm.setKernel(k);
    assertEquals(k, svm.getKernel());
  }
View Full Code Here

   * Test method for
   * {@link fr.lip6.jkernelmachines.density.SMODensity#train(java.util.List)}.
   */
  @Test
  public final void testTrainListOfT() {
    DoubleGaussL2 k = new DoubleGaussL2();
    ParzenDensity<double[]> de = new ParzenDensity<double[]>(k);
    de.train(train);

    for (double[] x : train) {
      assertTrue(!Double.isNaN(de.valueOf(x)));
View Full Code Here

  public void setUp() throws Exception {
   
    GaussianGenerator g = new GaussianGenerator(10, 5.0f, 1.0);
    train = g.generateList(10);
   
    DoubleGaussL2 k = new DoubleGaussL2(1.0);
    svm = new LaSVM<double[]>(k);
  }
View Full Code Here

    assertEquals(1.0, svm.getB(), 1e-15);
  }

  @Test
  public final void testSetKernel() {
    DoubleGaussL2 k = new DoubleGaussL2();
    svm.setKernel(k);
    assertEquals(k, svm.getKernel());
  }
View Full Code Here

    DataPreProcessing.centerList(trainlist);
    DataPreProcessing.reduceList(trainlist);
    DataPreProcessing.normalizeList(trainlist);
   
    //learning
    DoubleGaussL2 kernel = new DoubleGaussL2();
    kernel.setGamma(2.0);
    LaSVM<double[]> svm = new LaSVM<double[]>(kernel);
    svm.setC(10);
    svm.setE(5);
       
    AccuracyEvaluator<double[]> accev = new AccuracyEvaluator<double[]>();
View Full Code Here

   * {@link fr.lip6.jkernelmachines.density.SDCADensity#train(java.lang.Object)}
   * .
   */
  @Test
  public final void testTrainT() {
    DoubleGaussL2 k = new DoubleGaussL2();
    SDCADensity<double[]> de = new SDCADensity<double[]>(k);
    de.train(train.get(0));

    for (double[] x : train) {
      assertTrue(!Double.isNaN(de.valueOf(x)));
View Full Code Here

TOP

Related Classes of fr.lip6.jkernelmachines.kernel.extra.CustomTrainTestMatrixKernel

Copyright © 2018 www.massapicom. 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.