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

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.LinearMySVMLearner
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, CapabilityProvider, Learner, ParameterHandler, LoggingHandler, Observable<Operator>

public class LinearMySVMLearner
extends AbstractKernelBasedLearner

This class implements a special case of the MySVM by restricting it to the linear (dot) kernel. This way the weights of the linear combination can be extracted and stored solely in the resulting model. The model is optimized for small size / fast store and retrieve operations as well as time efficient during application.

Author:
Sebastian Land

Field Summary
static int KERNEL_DOT
          Indicates a linear kernel.
static java.lang.String PARAMETER_BALANCE_COST
          The parameter name for "Adapts Cpos and Cneg to the relative size of the classes"
static java.lang.String PARAMETER_C
           
static java.lang.String PARAMETER_CONVERGENCE_EPSILON
          The parameter name for "Precision on the KKT conditions"
static java.lang.String PARAMETER_EPSILON
          The parameter name for "Insensitivity constant.
static java.lang.String PARAMETER_EPSILON_MINUS
          The parameter name for "Epsilon for negative deviation only"
static java.lang.String PARAMETER_EPSILON_PLUS
          The parameter name for "Epsilon for positive deviation only"
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_L_NEG
          The parameter name for "A factor for the SVM complexity constant for negative examples"
static java.lang.String PARAMETER_L_POS
          The parameter name for "A factor for the SVM complexity constant for positive examples"
static java.lang.String PARAMETER_MAX_ITERATIONS
          The parameter name for "Stop after this many iterations"
static java.lang.String PARAMETER_QUADRATIC_LOSS_NEG
          The parameter name for "Use quadratic loss for negative deviation"
static java.lang.String PARAMETER_QUADRATIC_LOSS_POS
          The parameter name for "Use quadratic loss for positive deviation"
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
LinearMySVMLearner(OperatorDescription description)
           
 
Method Summary
protected  SVMInterface createSVM(Attribute label, Kernel kernel, SVMExamples sVMExamples, ExampleSet rapidMinerExamples)
           
 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)
          Trains a model.
 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_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_C

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

PARAMETER_L_POS

public static final java.lang.String PARAMETER_L_POS
The parameter name for "A factor for the SVM complexity constant for positive examples"

See Also:
Constant Field Values

PARAMETER_L_NEG

public static final java.lang.String PARAMETER_L_NEG
The parameter name for "A factor for the SVM complexity constant for negative examples"

See Also:
Constant Field Values

PARAMETER_EPSILON

public static final java.lang.String PARAMETER_EPSILON
The parameter name for "Insensitivity constant. No loss if prediction lies this close to true value"

See Also:
Constant Field Values

PARAMETER_EPSILON_PLUS

public static final java.lang.String PARAMETER_EPSILON_PLUS
The parameter name for "Epsilon for positive deviation only"

See Also:
Constant Field Values

PARAMETER_EPSILON_MINUS

public static final java.lang.String PARAMETER_EPSILON_MINUS
The parameter name for "Epsilon for negative deviation only"

See Also:
Constant Field Values

PARAMETER_BALANCE_COST

public static final java.lang.String PARAMETER_BALANCE_COST
The parameter name for "Adapts Cpos and Cneg to the relative size of the classes"

See Also:
Constant Field Values

PARAMETER_QUADRATIC_LOSS_POS

public static final java.lang.String PARAMETER_QUADRATIC_LOSS_POS
The parameter name for "Use quadratic loss for positive deviation"

See Also:
Constant Field Values

PARAMETER_QUADRATIC_LOSS_NEG

public static final java.lang.String PARAMETER_QUADRATIC_LOSS_NEG
The parameter name for "Use quadratic loss for negative deviation"

See Also:
Constant Field Values

KERNEL_DOT

public static final int KERNEL_DOT
Indicates a linear kernel.

See Also:
Constant Field Values
Constructor Detail

LinearMySVMLearner

public LinearMySVMLearner(OperatorDescription description)
Method Detail

createSVM

protected SVMInterface createSVM(Attribute label,
                                 Kernel kernel,
                                 SVMExamples sVMExamples,
                                 ExampleSet rapidMinerExamples)
                          throws OperatorException
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

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

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