Package libsvm

Examples of libsvm.svm_parameter


  }
 
  protected void trainInternal(FeatureVector featureVector) throws MaltChainedException {
    try {
      final svm_problem prob = readProblem(getInstanceInputStreamReader(".ins"));
      final svm_parameter param = getLibSvmParameters();
      if(svm.svm_check_parameter(prob, param) != null) {
        throw new LibException(svm.svm_check_parameter(prob, param));
      }
      owner.getGuide().getConfiguration().getConfigLogger().info("Creating LIBSVM model "+getFile(".moo").getName()+"\n");
      final PrintStream out = System.out;
View Full Code Here


  public void initAllowedLibOptionFlags() {
    allowedLibOptionFlags = "stdgrnmcepb";
  }
 
  private svm_parameter getLibSvmParameters() throws MaltChainedException {
    svm_parameter param = new svm_parameter();
 
    param.svm_type = Integer.parseInt(libOptions.get("s"));
    param.kernel_type = Integer.parseInt(libOptions.get("t"));
    param.degree = Integer.parseInt(libOptions.get("d"));
    param.gamma = Double.valueOf(libOptions.get("g")).doubleValue();
View Full Code Here

    return param;
  }
 
  private svm_problem readProblem(InputStreamReader isr) throws MaltChainedException {
    final svm_problem problem = new svm_problem();
    final svm_parameter param = getLibSvmParameters();
    final FeatureList featureList = new FeatureList();
    try {
      final BufferedReader fp = new BufferedReader(isr);
     
      problem.l = getNumberOfInstances();
View Full Code Here

   * @param paramString the parameter string to configure the LIBSVM learner.
   * @throws MaltChainedException
   */
  protected void initSvmParam(String paramString) throws MaltChainedException {
    this.paramString = paramString;
    svmParam = new svm_parameter();
    initParameters(svmParam);
    parseParameters(paramString, svmParam);
  }
View Full Code Here

        // 1- Form The File with SVM format
        // 2- loading the file using dataset loader into a problem object
        // 3- perform grid selection
        // 4- traing using the selected parameters and save into the model
        svm_problem prob = constructProblem(labels, trainingSamples);
        svm_parameter param = new svm_parameter();
        param.svm_type = svm_parameter.C_SVC;
        param.kernel_type = svm_parameter.RBF;
        param.gamma = 0.5;
        param.C = 1.0;
        svm_model theModel = svm.svm_train(prob, param);
View Full Code Here

    problem.x = tData.toArray(new svm_node[tData.size()][]); // feature
                                  // nodes
    problem.y = ArrayUtils
        .toPrimitive(tars.toArray(new Double[tars.size()])); // target
                                    // values
    svm_parameter parameters = new svm_parameter();

    parameters.gamma = gamma;
    parameters.svm_type = svm_parameter.C_SVC;
    parameters.kernel_type = svm_parameter.RBF;
    parameters.degree = 3;
View Full Code Here

  private void parse_command_line() {
    int i;
    String[] argv = new String[0];
    if (getParameters() != null)
      argv = getParameters().split(" ");
    param = new svm_parameter();
    // default values
    param.svm_type = svm_parameter.C_SVC;
    param.kernel_type = svm_parameter.RBF;
    param.degree = 3;
    param.gamma = 0; // 1/k
View Full Code Here

    }

    @Override
    public void train(Dataset dataset)
    {
        svm_parameter param = new svm_parameter();
        // default values
        param.svm_type = getLibsvmType();
        param.kernel_type = svm_parameter.LINEAR;
        param.degree = 3;
        param.gamma = 0;
View Full Code Here

    {
    }

    public static svm_parameter parseParameters(String paramString)
    {
        svm_parameter params = new svm_parameter();
        params.kernel_type = svm_parameter.LINEAR;
        params.degree = 3;
        params.gamma = 0;
        params.coef0 = 0;
        params.nu = 0.5;
View Full Code Here

TOP

Related Classes of libsvm.svm_parameter

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.