Examples of Svm


Examples of org.encog.ml.svm.SVM

  }
 
  public void testFactorySVM() {
    String architecture = "?->C(KERNEL=RBF,TYPE=NEW)->?";
    MLMethodFactory factory = new MLMethodFactory();
    SVM network = (SVM)factory.create(MLMethodFactory.TYPE_SVM, architecture, 4, 1);
    Assert.assertEquals(4,network.getInputCount());
    Assert.assertEquals(1,network.getOutputCount());
  }
View Full Code Here

Examples of org.encog.ml.svm.SVM

    InputSVM dialog = new InputSVM((SVM) file.getObject());

    if (dialog.process()) {
      double c = dialog.getC().getValue();
      double g = dialog.getGamma().getValue();
      SVM method = (SVM) file.getObject();
      SVMTrain train = new SVMTrain((SVM) method, trainingData);
      train.setC(c);
      train.setGamma(g);
      train.iteration();
      double error = method.calculateError(trainingData);
      if (EncogWorkBench.askQuestion("Training Done",
          "Error: " + Format.formatPercent(error)
              + "\nSave training?")) {
        file.save();
      }
View Full Code Here

Examples of org.encog.ml.svm.SVM

  }

  private void performSVMSearch(ProjectEGFile file, MLDataSet trainingData) {
    InputSearchSVM dialog = new InputSearchSVM();
    SVM method = (SVM) file.getObject();

    dialog.getBeginningGamma().setValue(SVMTrain.DEFAULT_GAMMA_BEGIN);
    dialog.getEndingGamma().setValue(SVMTrain.DEFAULT_GAMMA_END);
    dialog.getStepGamma().setValue(SVMTrain.DEFAULT_GAMMA_STEP);
    dialog.getBeginningC().setValue(SVMTrain.DEFAULT_CONST_BEGIN);
View Full Code Here

Examples of org.encog.ml.svm.SVM

    if (outputCount != 1) {
      throw new EncogError("SVM can only have an output size of 1.");
    }

    final SVM result = new SVM(inputCount, svmType, kernelType);

    return result;
  }
View Full Code Here

Examples of org.encog.ml.svm.SVM

    report.beginHTML();
    report.title(title);
    report.beginBody();
    report.h1(title);
    report.beginTable();
    SVM svm = (SVM)encogObject.getObject();
    report.tablePair("Input Count",""+svm.getInputCount());
    report.tablePair("SVM Type",svm.getSVMType().toString());
    report.tablePair("Kernel Type",svm.getKernelType().toString());
    report.endTable();
    report.endBody();
    report.endHTML();
   
    this.display(report.toString());
View Full Code Here

Examples of org.encog.ml.svm.SVM

    return temp.process(this.normalizedSunspots);
  }
 
  public SVM createNetwork()
  {
    SVM network = new SVM(WINDOW_SIZE,true);
    return network;
  }
View Full Code Here

Examples of org.encog.ml.svm.SVM

  }
 
  public void run()
  {
    normalizeSunspots(0.1,0.9);
    SVM network = createNetwork();
    MLDataSet training = generateTraining();
    train(network,training);
    predict(network);
   
  }
View Full Code Here

Examples of org.encog.ml.svm.SVM

    if (outputCount != 1) {
      throw new EncogError("SVM can only have an output size of 1.");
    }

    final SVM result = new SVM(inputCount, svmType, kernelType);

    return result;
  }
View Full Code Here

Examples of org.encog.ml.svm.SVM

  public final File SERIAL_FILENAME = TEMP_DIR.createFile("encogtest.ser");
 
  private SVM create()
  {
    MLDataSet training = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);
    SVM result = new SVM(2,SVMType.EpsilonSupportVectorRegression,KernelType.RadialBasisFunction);
    final SVMTrain train = new SVMTrain(result, training);
    train.iteration();
    return result;
  }
View Full Code Here

Examples of org.encog.ml.svm.SVM

    return result;
  }
 
  public void testPersistEG()
  {
    SVM network = create();

    EncogDirectoryPersistence.saveObject((EG_FILENAME), network);
    SVM network2 = (SVM)EncogDirectoryPersistence.loadObject((EG_FILENAME));
    validate(network2);
  }
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.