Examples of DoubleTriangleL2


Examples of fr.lip6.jkernelmachines.kernel.typed.DoubleTriangleL2

          .toString())) {
        k = new DoubleGaussL2(Double.parseDouble(kernelParamTextField
            .getText()));
      } else if ("TriangleL2".equalsIgnoreCase(kernelBox
          .getSelectedItem().toString())) {
        k = new DoubleTriangleL2(
            Double.parseDouble(kernelParamTextField.getText()));
      } else if ("Polynomial".equalsIgnoreCase(kernelBox
          .getSelectedItem().toString())) {
        k = new DoublePolynomial(Integer.parseInt(kernelParamTextField
            .getText()));
      } else if ("HPlolynomial".equalsIgnoreCase(kernelBox
          .getSelectedItem().toString())) {
        k = new DoubleHPolynomial(Integer.parseInt(kernelParamTextField
            .getText()));
      }

      LaSVM<double[]> svm = new LaSVM<double[]>(k);
      svm.setC(Double.parseDouble(regularizationField.getText()));
      svm.train(localTrain);

      // info
      classnameLabel.setText(svm.getClass().getSimpleName());
      double[] alphas = svm.getAlphas();
      int sv = 0;
      for (int s = 0; s < alphas.length; s++) {
        if (alphas[s] != 0) {
          sv++;
        }
      }
      svLabel.setText("" + sv);
      validate();
      // save current classifier
      model.classifier = svm;
    } else if ("smo".equalsIgnoreCase(classifierBox.getSelectedItem()
        .toString())) {
      Kernel<double[]> k = new DoubleLinear();
      if ("GaussianL2".equalsIgnoreCase(kernelBox.getSelectedItem()
          .toString())) {
        k = new DoubleGaussL2(Double.parseDouble(kernelParamTextField
            .getText()));
      } else if ("TriangleL2".equalsIgnoreCase(kernelBox
          .getSelectedItem().toString())) {
        k = new DoubleTriangleL2(
            Double.parseDouble(kernelParamTextField.getText()));
      } else if ("Polynomial".equalsIgnoreCase(kernelBox
          .getSelectedItem().toString())) {
        k = new DoublePolynomial(Integer.parseInt(kernelParamTextField
            .getText()));
View Full Code Here

Examples of fr.lip6.jkernelmachines.kernel.typed.DoubleTriangleL2

  /**
   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    gaussl2 = new DoubleTriangleL2();
  }
View Full Code Here

Examples of fr.lip6.jkernelmachines.kernel.typed.DoubleTriangleL2

  /**
   * Test method for {@link fr.lip6.jkernelmachines.kernel.typed.DoubleTriangleL2#DoubleGaussL2(double)}.
   */
  @Test
  public final void testDoubleGaussL2Double() {
    gaussl2 = new DoubleTriangleL2(1.0);
    assertEquals(gaussl2.getGamma(), 1.0, 1e-15);
  }
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.