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

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.AbstractMySVMLearner
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, CapabilityProvider, Learner, ParameterHandler, LoggingHandler, Observable<Operator>
Direct Known Subclasses:
JMySVMLearner, MyKLRLearner

public abstract class AbstractMySVMLearner
extends AbstractKernelBasedLearner

This is the abstract superclass for the support vector machine / KLR implementations of Stefan Rüping.

Author:
Ingo Mierswa ingomierswa Exp $
Keywords:
SVM

Field Summary
static int KERNEL_ANOVA
          Indicates an anova kernel.
static int KERNEL_DOT
          Indicates a linear kernel.
static int KERNEL_EPANECHNIKOV
          Indicates a epanechnikov kernel.
static int KERNEL_GAUSSIAN_COMBINATION
          Indicates a gaussian combination kernel.
static int KERNEL_MULTIQUADRIC
          Indicates a multiquadric kernel.
static int KERNEL_NEURAL
          Indicates a neural net kernel.
static int KERNEL_POLYNOMIAL
          Indicates a polynomial kernel.
static int KERNEL_RADIAL
          Indicates a rbf kernel.
static java.lang.String[] KERNEL_TYPES
          The kernels which can be used from RapidMiner for the mySVM / myKLR.
static java.lang.String PARAMETER_C
           
static java.lang.String PARAMETER_CALCULATE_WEIGHTS
           
static java.lang.String PARAMETER_CONVERGENCE_EPSILON
          The parameter name for "Precision on the KKT conditions"
static java.lang.String PARAMETER_KERNEL_A
          The parameter name for "The SVM kernel parameter a (neural).
static java.lang.String PARAMETER_KERNEL_B
          The parameter name for "The SVM kernel parameter b (neural).
static java.lang.String PARAMETER_KERNEL_CACHE
          The parameter name for "Size of the cache for kernel evaluations im MB "
static java.lang.String PARAMETER_KERNEL_DEGREE
          The parameter name for "The SVM kernel parameter degree (polynomial, anova, epanechnikov).
static java.lang.String PARAMETER_KERNEL_GAMMA
          The parameter name for "The SVM kernel parameter gamma (radial, anova).
static java.lang.String PARAMETER_KERNEL_SHIFT
          The parameter name for "The SVM kernel parameter shift (multiquadric).
static java.lang.String PARAMETER_KERNEL_SIGMA1
          The parameter name for "The SVM kernel parameter sigma1 (epanechnikov, gaussian combination, multiquadric).
static java.lang.String PARAMETER_KERNEL_SIGMA2
          The parameter name for "The SVM kernel parameter sigma2 (gaussian combination).
static java.lang.String PARAMETER_KERNEL_SIGMA3
          The parameter name for "The SVM kernel parameter sigma3 (gaussian combination).
static java.lang.String PARAMETER_KERNEL_TYPE
           
static java.lang.String PARAMETER_MAX_ITERATIONS
          The parameter name for "Stop after this many iterations"
static java.lang.String PARAMETER_RETURN_OPTIMIZATION_PERFORMANCE
          The parameter name for "Indicates if final optimization fitness should be returned as performance.
static java.lang.String PARAMETER_SCALE
          The parameter name for "Scale the example values and store the scaling parameters for test set.
 
Fields inherited from interface com.rapidminer.operator.learner.CapabilityProvider
PROPERTY_RAPIDMINER_GENERAL_CAPABILITIES_WARN
 
Constructor Summary
AbstractMySVMLearner(OperatorDescription description)
           
 
Method Summary
 boolean canCalculateWeights()
          Returns true if this learner is capable of computing attribute weights.
static Kernel createKernel(int kernelType)
          Creates a new kernel of the given type.
abstract  SVMInterface createSVM(Attribute label, Kernel kernel, SVMExamples svmExamples, ExampleSet rapidMinerExamples)
          Creates a new SVM according to the given label.
abstract  AbstractMySVMModel createSVMModel(ExampleSet exampleSet, SVMExamples svmExamples, Kernel kernel, int kernelType)
          Creates a new SVM model from the given data.
protected  Kernel getKernel()
          Returns the kernel of this SVM.
 PerformanceVector getOptimizationPerformance()
          Returns the optimization performance of the best result.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
protected  SVMInterface getSVM()
          Returns the used SVM.
 MetaDataError getWeightCalculationError(OutputPort weightPort)
           
 AttributeWeights getWeights(ExampleSet exampleSet)
          Returns the weights for all features.
 Model learn(ExampleSet exampleSet)
          Trains a model.
 boolean shouldCalculateWeights()
          Returns true if the user has specified that weights should be calculated.
 boolean shouldDeliverOptimizationPerformance()
          Returns the value of the corresponding parameter.
 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
canEstimatePerformance, doWork, doWork, getEstimatedPerformance, getExampleSetInputPort, getWeights, onlyWarnForNonSufficientCapabilities, shouldAutoConnect, 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, getResourceConsumptionEstimator, 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_KERNEL_GAMMA

public static final java.lang.String PARAMETER_KERNEL_GAMMA
The parameter name for "The SVM kernel parameter gamma (radial, anova)."

See Also:
Constant Field Values

PARAMETER_KERNEL_SIGMA1

public static final java.lang.String PARAMETER_KERNEL_SIGMA1
The parameter name for "The SVM kernel parameter sigma1 (epanechnikov, gaussian combination, multiquadric)."

See Also:
Constant Field Values

PARAMETER_KERNEL_SIGMA2

public static final java.lang.String PARAMETER_KERNEL_SIGMA2
The parameter name for "The SVM kernel parameter sigma2 (gaussian combination)."

See Also:
Constant Field Values

PARAMETER_KERNEL_SIGMA3

public static final java.lang.String PARAMETER_KERNEL_SIGMA3
The parameter name for "The SVM kernel parameter sigma3 (gaussian combination)."

See Also:
Constant Field Values

PARAMETER_KERNEL_SHIFT

public static final java.lang.String PARAMETER_KERNEL_SHIFT
The parameter name for "The SVM kernel parameter shift (multiquadric)."

See Also:
Constant Field Values

PARAMETER_KERNEL_DEGREE

public static final java.lang.String PARAMETER_KERNEL_DEGREE
The parameter name for "The SVM kernel parameter degree (polynomial, anova, epanechnikov)."

See Also:
Constant Field Values

PARAMETER_KERNEL_A

public static final java.lang.String PARAMETER_KERNEL_A
The parameter name for "The SVM kernel parameter a (neural)."

See Also:
Constant Field Values

PARAMETER_KERNEL_B

public static final java.lang.String PARAMETER_KERNEL_B
The parameter name for "The SVM kernel parameter b (neural)."

See Also:
Constant Field Values

PARAMETER_KERNEL_CACHE

public static final java.lang.String PARAMETER_KERNEL_CACHE
The parameter name for "Size of the cache for kernel evaluations im MB "

See Also:
Constant Field Values

PARAMETER_CONVERGENCE_EPSILON

public static final java.lang.String PARAMETER_CONVERGENCE_EPSILON
The parameter name for "Precision on the KKT conditions"

See Also:
Constant Field Values

PARAMETER_MAX_ITERATIONS

public static final java.lang.String PARAMETER_MAX_ITERATIONS
The parameter name for "Stop after this many iterations"

See Also:
Constant Field Values

PARAMETER_SCALE

public static final java.lang.String PARAMETER_SCALE
The parameter name for "Scale the example values and store the scaling parameters for test set."

See Also:
Constant Field Values

PARAMETER_RETURN_OPTIMIZATION_PERFORMANCE

public static final java.lang.String PARAMETER_RETURN_OPTIMIZATION_PERFORMANCE
The parameter name for "Indicates if final optimization fitness should be returned as performance."

See Also:
Constant Field Values

PARAMETER_C

public static final java.lang.String PARAMETER_C
See Also:
Constant Field Values

PARAMETER_KERNEL_TYPE

public static final java.lang.String PARAMETER_KERNEL_TYPE
See Also:
Constant Field Values

PARAMETER_CALCULATE_WEIGHTS

public static final java.lang.String PARAMETER_CALCULATE_WEIGHTS
See Also:
Constant Field Values

KERNEL_TYPES

public static final java.lang.String[] KERNEL_TYPES
The kernels which can be used from RapidMiner for the mySVM / myKLR.


KERNEL_DOT

public static final int KERNEL_DOT
Indicates a linear kernel.

See Also:
Constant Field Values

KERNEL_RADIAL

public static final int KERNEL_RADIAL
Indicates a rbf kernel.

See Also:
Constant Field Values

KERNEL_POLYNOMIAL

public static final int KERNEL_POLYNOMIAL
Indicates a polynomial kernel.

See Also:
Constant Field Values

KERNEL_NEURAL

public static final int KERNEL_NEURAL
Indicates a neural net kernel.

See Also:
Constant Field Values

KERNEL_ANOVA

public static final int KERNEL_ANOVA
Indicates an anova kernel.

See Also:
Constant Field Values

KERNEL_EPANECHNIKOV

public static final int KERNEL_EPANECHNIKOV
Indicates a epanechnikov kernel.

See Also:
Constant Field Values

KERNEL_GAUSSIAN_COMBINATION

public static final int KERNEL_GAUSSIAN_COMBINATION
Indicates a gaussian combination kernel.

See Also:
Constant Field Values

KERNEL_MULTIQUADRIC

public static final int KERNEL_MULTIQUADRIC
Indicates a multiquadric kernel.

See Also:
Constant Field Values
Constructor Detail

AbstractMySVMLearner

public AbstractMySVMLearner(OperatorDescription description)
Method Detail

getWeightCalculationError

public MetaDataError getWeightCalculationError(OutputPort weightPort)
Overrides:
getWeightCalculationError in class AbstractLearner

createSVM

public abstract SVMInterface createSVM(Attribute label,
                                       Kernel kernel,
                                       SVMExamples svmExamples,
                                       ExampleSet rapidMinerExamples)
                                throws OperatorException
Creates a new SVM according to the given label.

Throws:
OperatorException

createSVMModel

public abstract AbstractMySVMModel createSVMModel(ExampleSet exampleSet,
                                                  SVMExamples svmExamples,
                                                  Kernel kernel,
                                                  int kernelType)
Creates a new SVM model from the given data.


getKernel

protected Kernel getKernel()
Returns the kernel of this SVM.


getSVM

protected SVMInterface getSVM()
Returns the used SVM.


shouldDeliverOptimizationPerformance

public boolean shouldDeliverOptimizationPerformance()
Returns the value of the corresponding parameter.

Overrides:
shouldDeliverOptimizationPerformance in class AbstractLearner

getOptimizationPerformance

public PerformanceVector getOptimizationPerformance()
Returns the optimization performance of the best result. This method must be called after training, not before.

Overrides:
getOptimizationPerformance in class AbstractLearner

shouldCalculateWeights

public boolean shouldCalculateWeights()
Returns true if the user has specified that weights should be calculated.

Specified by:
shouldCalculateWeights in interface Learner
Overrides:
shouldCalculateWeights in class AbstractLearner

canCalculateWeights

public boolean canCalculateWeights()
Description copied from class: AbstractLearner
Returns true if this learner is capable of computing attribute weights. If this method returns true, also override AbstractLearner.getWeights(ExampleSet)

Overrides:
canCalculateWeights in class AbstractLearner

getWeights

public AttributeWeights getWeights(ExampleSet exampleSet)
                            throws OperatorException
Returns the weights for all features.

Specified by:
getWeights in interface Learner
Overrides:
getWeights in class AbstractLearner
Throws:
OperatorException

learn

public Model learn(ExampleSet exampleSet)
            throws OperatorException
Description copied from interface: Learner
Trains a model. This method should be called by apply() and is implemented by subclasses.

Throws:
OperatorException

createKernel

public static Kernel createKernel(int kernelType)
Creates a new kernel of the given type. The kernel type has to be one out of KERNEL_DOT, KERNEL_RADIAL, KERNEL_POLYNOMIAL, KERNEL_NEURAL, KERNEL_EPANECHNIKOV, KERNEL_GAUSSIAN_COMBINATION, or KERNEL_MULTIQUADRIC.


supportsCapability

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


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


Copyright © 2001-2009 by Rapid-I