com.rapidminer.operator.preprocessing.sampling
Class RatioStratifiedSampling

java.lang.Object
  extended by com.rapidminer.tools.AbstractObservable<Operator>
      extended by com.rapidminer.operator.Operator
          extended by com.rapidminer.operator.AbstractExampleSetProcessing
              extended by com.rapidminer.operator.preprocessing.AbstractDataProcessing
                  extended by com.rapidminer.operator.preprocessing.sampling.AbstractSamplingOperator
                      extended by com.rapidminer.operator.preprocessing.sampling.AbstractStratifiedSampling
                          extended by com.rapidminer.operator.preprocessing.sampling.RatioStratifiedSampling
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ResourceConsumer, ParameterHandler, LoggingHandler, Observable<Operator>

public class RatioStratifiedSampling
extends AbstractStratifiedSampling

Stratified sampling operator. This operator performs a random sampling of a given fraction. In contrast to the simple sampling operator, this operator performs a stratified sampling for data sets with nominal label attributes, i.e. the class distributions remains (almost) the same after sampling. Hence, this operator cannot be applied on data sets without a label or with a numerical label. In these cases a simple sampling without stratification is performed.

Author:
Ingo Mierswa

Field Summary
static java.lang.String PARAMETER_SAMPLE_RATIO
          The parameter name for "The fraction of examples which should be sampled"
 
Constructor Summary
RatioStratifiedSampling(OperatorDescription description)
           
 
Method Summary
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 double getRatio(ExampleSet exampleSet)
          This method should return the ratio used for stratifiedSampling
protected  MDInteger getSampledSize(ExampleSetMetaData emd)
          subclasses must implement this method for exact size meta data.
 
Methods inherited from class com.rapidminer.operator.preprocessing.sampling.AbstractStratifiedSampling
apply
 
Methods inherited from class com.rapidminer.operator.preprocessing.sampling.AbstractSamplingOperator
modifyMetaData, writesIntoExistingData
 
Methods inherited from class com.rapidminer.operator.AbstractExampleSetProcessing
doWork, getExampleSetInputPort, getExampleSetOutputPort, getInputPort, getRequiredMetaData, shouldAutoConnect
 
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
 

Field Detail

PARAMETER_SAMPLE_RATIO

public static final java.lang.String PARAMETER_SAMPLE_RATIO
The parameter name for "The fraction of examples which should be sampled"

See Also:
Constant Field Values
Constructor Detail

RatioStratifiedSampling

public RatioStratifiedSampling(OperatorDescription description)
Method Detail

getSampledSize

protected MDInteger getSampledSize(ExampleSetMetaData emd)
                            throws UndefinedParameterError
Description copied from class: AbstractSamplingOperator
subclasses must implement this method for exact size meta data.

Specified by:
getSampledSize in class AbstractSamplingOperator
Throws:
UndefinedParameterError

getRatio

public double getRatio(ExampleSet exampleSet)
                throws OperatorException
Description copied from class: AbstractStratifiedSampling
This method should return the ratio used for stratifiedSampling

Specified by:
getRatio in class AbstractStratifiedSampling
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 AbstractStratifiedSampling


Copyright © 2001-2009 by Rapid-I