com.rapidminer.operator.learner.functions.kernel
Class LibSVMLearner

java.lang.Object
  extended by com.rapidminer.tools.AbstractObservable<Operator>
      extended by com.rapidminer.operator.Operator
          extended by com.rapidminer.operator.learner.AbstractLearner
              extended by com.rapidminer.operator.learner.functions.kernel.AbstractKernelBasedLearner
                  extended by com.rapidminer.operator.learner.functions.kernel.LibSVMLearner
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, CapabilityProvider, Learner, ParameterHandler, LoggingHandler, Observable<Operator>

public class LibSVMLearner
extends AbstractKernelBasedLearner

Applies the libsvm learner by Chih-Chung Chang and Chih-Jen Lin. The SVM is a powerful method for both classification and regression. This operator supports the SVM types C-SVC and nu-SVC for classification tasks and epsilon-SVR and nu-SVR for regression tasks. Supports also multiclass learning and probability estimation based on Platt scaling for proper confidence values after applying the learned model on a classification data set.

Author:
Ingo Mierswa
Keywords:
SVM

Field Summary
static java.lang.String[] KERNEL_TYPES
          The different kernel types implemented by the LibSVM package.
static java.lang.String PARAMETER_C
          The parameter name for "The cost parameter C for c_svc, epsilon_svr, and nu_svr.
static java.lang.String PARAMETER_CACHE_SIZE
          The parameter name for "Cache size in Megabyte.
static java.lang.String PARAMETER_CALCULATE_CONFIDENCES
          The parameter name for "Indicates if proper confidence values should be calculated.
static java.lang.String PARAMETER_CLASS_WEIGHTS
          The parameter name for "The weights w for all classes (first column: class name, second column: weight), i.e. set the parameters C of each class w * C (empty: using 1 for all classes where the weight was not defined).
static java.lang.String PARAMETER_COEF0
          The parameter name for "The parameter coef0 for polynomial and sigmoid kernel functions.
static java.lang.String PARAMETER_CONFIDENCE_FOR_MULTICLASS
          The parameter name for "Indicates if proper confidence values should be calculated.
static java.lang.String PARAMETER_DEGREE
          The parameter name for "The degree for a polynomial kernel function.
static java.lang.String PARAMETER_EPSILON
          The parameter name for "Tolerance of termination criterion.
static java.lang.String PARAMETER_GAMMA
          The parameter name for "The parameter gamma for polynomial, rbf, and sigmoid kernel functions (0 means 1/#attributes).
static java.lang.String PARAMETER_KERNEL_TYPE
          The parameter name for "The type of the kernel functions"
static java.lang.String PARAMETER_NU
          The parameter name for "The parameter nu for nu_svc, one_class, and nu_svr.
static java.lang.String PARAMETER_ONECLASS_CLASSIFICATION
          The parameter name for "Indicates if the traditional libsvm one-class classification behavior should be used.
static java.lang.String PARAMETER_P
          The parameter name for "Tolerance of loss function of epsilon-SVR.
static java.lang.String PARAMETER_SHRINKING
          The parameter name for "Whether to use the shrinking heuristics.
static java.lang.String PARAMETER_SVM_TYPE
          The parameter name for "SVM for classification (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and distribution estimation (one-class)"
static int SVM_TYPE_C_SVC
           
static int SVM_TYPE_EPS_SVR
           
static int SVM_TYPE_NU_SVC
           
static int SVM_TYPE_NU_SVR
           
static int SVM_TYPE_ONE_CLASS
           
static java.lang.String[] SVM_TYPES
          The different SVM types implemented by the LibSVM package.
 
Fields inherited from interface com.rapidminer.operator.learner.CapabilityProvider
PROPERTY_RAPIDMINER_GENERAL_CAPABILITIES_WARN
 
Constructor Summary
LibSVMLearner(OperatorDescription description)
           
 
Method Summary
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 ResourceConsumptionEstimator getResourceConsumptionEstimator()
          Subclasses can override this method if they are able to estimate the consumed resources (CPU time and memory), based on their input.
 Model learn(ExampleSet exampleSet)
          Learns a new SVM model with the LibSVM package.
protected static libsvm.svm_node[] makeNodes(Example e, FastExample2SparseTransform ripper)
          Creates a data node row for the LibSVM (sparse format, i.e. each node keeps the index and the value if not default).
 boolean supportsCapability(OperatorCapability lc)
          Checks for Learner capabilities.
 
Methods inherited from class com.rapidminer.operator.learner.functions.kernel.AbstractKernelBasedLearner
getModelClass
 
Methods inherited from class com.rapidminer.operator.learner.AbstractLearner
canCalculateWeights, canEstimatePerformance, doWork, doWork, getEstimatedPerformance, getExampleSetInputPort, getOptimizationPerformance, getWeightCalculationError, getWeights, getWeights, onlyWarnForNonSufficientCapabilities, shouldAutoConnect, shouldCalculateWeights, shouldDeliverOptimizationPerformance, shouldEstimatePerformance
 
Methods inherited from class com.rapidminer.operator.Operator
acceptsInput, addError, addError, addValue, addWarning, apply, apply, assumePreconditionsSatisfied, checkAll, checkAllExcludingMetaData, checkDeprecations, checkForStop, checkIO, checkProperties, clear, clearErrorList, cloneOperator, collectErrors, createExperimentTree, createExperimentTree, createFromXML, createFromXML, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, disconnectPorts, execute, fireUpdate, freeMemory, getAddOnlyAdditionalOutput, getApplyCount, getCompatibilityLevel, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getDOMRepresentation, getEncoding, getErrorList, getExecutionUnit, getExperiment, getIncompatibleVersionChanges, getInput, getInput, getInput, getInputClasses, getInputDescription, getInputPorts, getIODescription, getLog, getLogger, getName, getNumberOfBreakpoints, getOperatorClassName, getOperatorDescription, getOutputClasses, getOutputPorts, getParameter, getParameterAsBoolean, getParameterAsChar, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsRepositoryLocation, getParameterAsString, getParameterHandler, getParameterList, getParameters, getParameterTupel, getParameterType, getParent, getPortOwner, getProcess, getRoot, getStartTime, getTransformer, getUserDescription, getValue, getValues, getXML, getXML, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isDirty, isEnabled, isExpanded, isParallel, isParameterSet, isRunning, log, log, logError, logNote, logWarning, lookupOperator, makeDirty, makeDirtyOnUpdate, notifyRenaming, performAdditionalChecks, preAutoWire, processFinished, processStarts, producesOutput, propagateDirtyness, register, registerOperator, remove, removeAndKeepConnections, rename, resume, setBreakpoint, setCompatibilityLevel, setEnabled, setEnclosingProcess, setExpanded, setInput, setListParameter, setPairParameter, setParameter, setParameters, setUserDescription, shouldAutoConnect, shouldStopStandaloneExecution, toString, transformMetaData, unregisterOperator, updateExecutionOrder, walk, writeXML, writeXML
 
Methods inherited from class com.rapidminer.tools.AbstractObservable
addObserver, addObserverAsFirst, fireUpdate, removeObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.learner.Learner
getName
 

Field Detail

PARAMETER_SVM_TYPE

public static final java.lang.String PARAMETER_SVM_TYPE
The parameter name for "SVM for classification (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and distribution estimation (one-class)"

See Also:
Constant Field Values

PARAMETER_KERNEL_TYPE

public static final java.lang.String PARAMETER_KERNEL_TYPE
The parameter name for "The type of the kernel functions"

See Also:
Constant Field Values

PARAMETER_DEGREE

public static final java.lang.String PARAMETER_DEGREE
The parameter name for "The degree for a polynomial kernel function."

See Also:
Constant Field Values

PARAMETER_GAMMA

public static final java.lang.String PARAMETER_GAMMA
The parameter name for "The parameter gamma for polynomial, rbf, and sigmoid kernel functions (0 means 1/#attributes)."

See Also:
Constant Field Values

PARAMETER_COEF0

public static final java.lang.String PARAMETER_COEF0
The parameter name for "The parameter coef0 for polynomial and sigmoid kernel functions."

See Also:
Constant Field Values

PARAMETER_C

public static final java.lang.String PARAMETER_C
The parameter name for "The cost parameter C for c_svc, epsilon_svr, and nu_svr."

See Also:
Constant Field Values

PARAMETER_NU

public static final java.lang.String PARAMETER_NU
The parameter name for "The parameter nu for nu_svc, one_class, and nu_svr."

See Also:
Constant Field Values

PARAMETER_CACHE_SIZE

public static final java.lang.String PARAMETER_CACHE_SIZE
The parameter name for "Cache size in Megabyte."

See Also:
Constant Field Values

PARAMETER_EPSILON

public static final java.lang.String PARAMETER_EPSILON
The parameter name for "Tolerance of termination criterion."

See Also:
Constant Field Values

PARAMETER_P

public static final java.lang.String PARAMETER_P
The parameter name for "Tolerance of loss function of epsilon-SVR."

See Also:
Constant Field Values

PARAMETER_CLASS_WEIGHTS

public static final java.lang.String PARAMETER_CLASS_WEIGHTS
The parameter name for "The weights w for all classes (first column: class name, second column: weight), i.e. set the parameters C of each class w * C (empty: using 1 for all classes where the weight was not defined)."

See Also:
Constant Field Values

PARAMETER_SHRINKING

public static final java.lang.String PARAMETER_SHRINKING
The parameter name for "Whether to use the shrinking heuristics."

See Also:
Constant Field Values

PARAMETER_CALCULATE_CONFIDENCES

public static final java.lang.String PARAMETER_CALCULATE_CONFIDENCES
The parameter name for "Indicates if proper confidence values should be calculated."

See Also:
Constant Field Values

PARAMETER_ONECLASS_CLASSIFICATION

public static final java.lang.String PARAMETER_ONECLASS_CLASSIFICATION
The parameter name for "Indicates if the traditional libsvm one-class classification behavior should be used."

See Also:
Constant Field Values

PARAMETER_CONFIDENCE_FOR_MULTICLASS

public static final java.lang.String PARAMETER_CONFIDENCE_FOR_MULTICLASS
The parameter name for "Indicates if proper confidence values should be calculated."

See Also:
Constant Field Values

SVM_TYPES

public static final java.lang.String[] SVM_TYPES
The different SVM types implemented by the LibSVM package.


SVM_TYPE_C_SVC

public static final int SVM_TYPE_C_SVC
See Also:
Constant Field Values

SVM_TYPE_NU_SVC

public static final int SVM_TYPE_NU_SVC
See Also:
Constant Field Values

SVM_TYPE_ONE_CLASS

public static final int SVM_TYPE_ONE_CLASS
See Also:
Constant Field Values

SVM_TYPE_EPS_SVR

public static final int SVM_TYPE_EPS_SVR
See Also:
Constant Field Values

SVM_TYPE_NU_SVR

public static final int SVM_TYPE_NU_SVR
See Also:
Constant Field Values

KERNEL_TYPES

public static final java.lang.String[] KERNEL_TYPES
The different kernel types implemented by the LibSVM package.

Constructor Detail

LibSVMLearner

public LibSVMLearner(OperatorDescription description)
Method Detail

supportsCapability

public boolean supportsCapability(OperatorCapability lc)
Description copied from interface: CapabilityProvider
Checks for Learner capabilities. Should return true if the given capability is supported.


makeNodes

protected static libsvm.svm_node[] makeNodes(Example e,
                                             FastExample2SparseTransform ripper)
Creates a data node row for the LibSVM (sparse format, i.e. each node keeps the index and the value if not default).


learn

public Model learn(ExampleSet exampleSet)
            throws OperatorException
Learns a new SVM model with the LibSVM package.

Throws:
OperatorException

getParameterTypes

public java.util.List<ParameterType> getParameterTypes()
Description copied from class: Operator
Returns a list of ParameterTypes describing the parameters of this operator. The default implementation returns an empty list if no input objects can be retained and special parameters for those input objects which can be prevented from being consumed. ATTENTION! This will create new parameterTypes. For calling already existing parameter types use getParameters().getParameterTypes();

Specified by:
getParameterTypes in interface ParameterHandler
Overrides:
getParameterTypes in class Operator

getResourceConsumptionEstimator

public ResourceConsumptionEstimator getResourceConsumptionEstimator()
Description copied from class: Operator
Subclasses can override this method if they are able to estimate the consumed resources (CPU time and memory), based on their input. The default implementation returns null.

Specified by:
getResourceConsumptionEstimator in interface ResourceConsumer
Overrides:
getResourceConsumptionEstimator in class Operator


Copyright © 2001-2009 by Rapid-I