001    /*
002     * JNI_SVM-light - A Java Native Interface for SVM-light
003     * 
004     * Copyright (C) 2005 
005     * Tom Crecelius & Martin Theobald 
006     * Max-Planck Institute for Computer Science
007     * 
008     * This program is free software; you can redistribute it and/or modify it under
009     * the terms of the GNU General Public License as published by the Free Software
010     * Foundation.
011     * 
012     * This program is distributed in the hope that it will be useful, but WITHOUT
013     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
014     * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
015     * details.
016     * 
017     * You should have received a copy of the GNU General Public License along with
018     * this program; if not, write to the Free Software Foundation, Inc., 51
019     * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
020     */
021    
022    package jnisvmlight;
023    
024    /**
025     * Kernel parameters used by SVM-light.
026     * 
027     * @author Tom Crecelius & Martin Theobald
028     */
029    public class KernelParam {
030    
031      /** Uses a linear kernel type. */
032      public static final int LINEAR = 0;
033    
034      /** Uses a polynomial kernel type. */
035      public static final int POLYNOMIAL = 1;
036    
037      /** Use a radial base kernel type. */
038      public static final int RBF = 2;
039    
040      /** Uses as sigmoid kernel type. */
041      public static final int SIGMOID = 3;
042    
043      /** Constant coefficient for extended kernels. */
044      public double coef_const;
045    
046      /** Linear coefficient for extended kernels. */
047      public double coef_lin;
048    
049      /** For user supplied kernel. */
050      public String custom;
051    
052      /** Selects between LINEAR, POLYNOMIAL, RBF, or SIGMOID kernel type. */
053      public long kernel_type;
054    
055      /** Degree of polynomial kernel. */
056      public long poly_degree;
057    
058      /** Gamma constant for a radial base kernel. */
059      public double rbf_gamma;
060    
061      /** Initializes the kernel parameters with the default SVM-light values. */
062      public KernelParam() {
063        this.kernel_type = LINEAR;
064        this.poly_degree = 3;
065        this.rbf_gamma = 1.0;
066        this.coef_lin = 1.0;
067        this.coef_const = 0.0;
068        this.custom = new String("empty");
069      }
070    }