All Downloads are FREE. Search and download functionalities are using the official Maven repository.

weka.classifiers.functions.supportVector.RegSMO Maven / Gradle / Ivy

Go to download

The Waikato Environment for Knowledge Analysis (WEKA), a machine learning workbench. This version represents the developer version, the "bleeding edge" of development, you could say. New functionality gets added to this version.

There is a newer version: 3.9.6
Show newest version
/*
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see .
 */

/*
 *    RegSMO.java
 *    Copyright (C) 2006-2012 University of Waikato, Hamilton, New Zealand
 *
 */

package weka.classifiers.functions.supportVector;

import java.util.Collections;
import java.util.Enumeration;
import java.util.Vector;

import weka.core.Instances;
import weka.core.Option;
import weka.core.RevisionUtils;
import weka.core.TechnicalInformation;
import weka.core.TechnicalInformation.Field;
import weka.core.TechnicalInformation.Type;
import weka.core.TechnicalInformationHandler;
import weka.core.Utils;

/**
 *  Implementation of SMO for support vector regression
 * as described in :
*
* A.J. Smola, B. Schoelkopf (1998). A tutorial on support vector regression. *

* * * BibTeX: * *

 * @misc{Smola1998,
 *    author = {A.J. Smola and B. Schoelkopf},
 *    note = {NeuroCOLT2 Technical Report NC2-TR-1998-030},
 *    title = {A tutorial on support vector regression},
 *    year = {1998}
 * }
 * 
*

* * * Valid options are: *

* *

 * -P <double>
 *  The epsilon for round-off error.
 *  (default 1.0e-12)
 * 
* *
 * -L <double>
 *  The epsilon parameter in epsilon-insensitive loss function.
 *  (default 1.0e-3)
 * 
* *
 * -W <double>
 *  The random number seed.
 *  (default 1)
 * 
* * * * @author Remco Bouckaert ([email protected],[email protected]) * @version $Revision: 10169 $ */ public class RegSMO extends RegOptimizer implements TechnicalInformationHandler { /** for serialization */ private static final long serialVersionUID = -7504070793279598638L; /** * tolerance parameter, smaller changes on alpha in inner loop will be ignored **/ protected double m_eps = 1.0e-12; /** Precision constant for updating sets */ protected final static double m_Del = 1e-10; // 1000 * Double.MIN_VALUE; /** * error cache containing m_error[i] = SVMOutput(i) - m_target[i] - m_b
* note, we don't need m_b in the cache, since if we do, we need to maintain * it when m_b is updated */ double[] m_error; /** alpha value for first candidate **/ protected double m_alpha1; /** alpha* value for first candidate **/ protected double m_alpha1Star; /** alpha value for second candidate **/ protected double m_alpha2; /** alpha* value for second candidate **/ protected double m_alpha2Star; /** * default constructor */ public RegSMO() { super(); } /** * Returns a string describing classifier * * @return a description suitable for displaying in the explorer/experimenter * gui */ public String globalInfo() { return "Implementation of SMO for support vector regression as described " + "in :\n\n" + getTechnicalInformation().toString(); } /** * Returns an instance of a TechnicalInformation object, containing detailed * information about the technical background of this class, e.g., paper * reference or book this class is based on. * * @return the technical information about this class */ @Override public TechnicalInformation getTechnicalInformation() { TechnicalInformation result; result = new TechnicalInformation(Type.MISC); result.setValue(Field.AUTHOR, "A.J. Smola and B. Schoelkopf"); result.setValue(Field.TITLE, "A tutorial on support vector regression"); result.setValue(Field.NOTE, "NeuroCOLT2 Technical Report NC2-TR-1998-030"); result.setValue(Field.YEAR, "1998"); return result; } /** * Returns an enumeration describing the available options * * @return an enumeration of all the available options */ @Override public Enumeration




© 2015 - 2024 Weber Informatics LLC | Privacy Policy