Package org.encog.ml.svm

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


  }

  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

    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

    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

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

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

    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

  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

    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

    validate(network2);
  }
 
  public void testPersistSerial() throws IOException, ClassNotFoundException
  {
    SVM network = create();
   
    SerializeObject.save(SERIAL_FILENAME, network);
    SVM network2 = (SVM)SerializeObject.load(SERIAL_FILENAME);
       
    validate(network2);
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.svm.SVM

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.