com.rapidminer.operator.io
Class StataExampleSource

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.io.AbstractReader<ExampleSet>
          extended by com.rapidminer.operator.io.AbstractExampleSource
              extended by com.rapidminer.operator.io.BytewiseExampleSource
                  extended by com.rapidminer.operator.io.StataExampleSource
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler

public class StataExampleSource
extends BytewiseExampleSource

This operator can read stata files. Currently only stata files of version 113 or 114 are supported.

Author:
Tobias Malbrecht
Keywords:
stata

Field Summary
static java.lang.String[] ATTRIBUTE_NAMING_MODES
          String descriptions of attribute naming modes.
static int FORCE_NUMERIC
          Force attributes to be numeric even if value labels exist.
static java.lang.String[] HANDLE_VALUE_LABELS_MODES
          String descriptions of value label handling modes.
static int IGNORE
          Ignore existing value labels but let attribute be nominal.
static java.lang.String PARAMETER_ATTRIBUTE_NAMING_MODE
          The parameter name for "Determines which attribute properties should be used for attribute naming.
static java.lang.String PARAMETER_HANDLE_VALUE_LABELS
          The parameter name for "Specifies how to handle attributes with value labels, i.e. whether to ignore the labels or how to use them.
static java.lang.String PARAMETER_LOCAL_RANDOM_SEED
          The parameter name for "Use the given random seed instead of global random numbers (only for permutation, -1: use global).
static java.lang.String PARAMETER_SAMPLE_RATIO
          The parameter name for "The fraction of the data set which should be read (1 = all; only used if sample_size = -1)"
static java.lang.String PARAMETER_SAMPLE_SIZE
          The parameter name for "The exact number of samples which should be read (-1 = all; if not -1, sample_ratio will not have any effect)"
static int USE_ADDITIONALLY
          Use existing value labels for labeled values.
static int USE_EXCLUSIVELY
          Use existing value labels and set all values without labels to unknown.
static int USE_VAR_LABEL
          Only use variable label as attribute name.
static int USE_VAR_LABEL_NAMED
          Use variable label with name in parentheses as attribute name.
static int USE_VAR_NAME
          Only use variable name as attribute name.
static int USE_VAR_NAME_LABELED
          Use variable name with label in parentheses as attribute name.
 
Fields inherited from class com.rapidminer.operator.io.BytewiseExampleSource
GENERIC_ERROR_MESSAGE, LENGTH_BYTE, LENGTH_DOUBLE, LENGTH_INT_32, PARAMETER_DATAMANAGEMENT, PARAMETER_FILENAME, UNSPECIFIED_ERROR_MESSAGE
 
Constructor Summary
StataExampleSource(OperatorDescription description)
           
 
Method Summary
protected  java.lang.String getFileSuffix()
          Returns the suffix of the files which should be read by the input operator.
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
protected  ExampleSet readStream(java.io.InputStream inputStream, DataRowFactory dataRowFactory)
          Reads the given file and constructs an example set from the read data.
 
Methods inherited from class com.rapidminer.operator.io.BytewiseExampleSource
createExampleSet, extract2ByteInt, extractDouble, extractFloat, extractInt, extractString, read, read, read, read, readWithoutLengthCheck
 
Methods inherited from class com.rapidminer.operator.io.AbstractExampleSource
read
 
Methods inherited from class com.rapidminer.operator.io.AbstractReader
apply, getInputClasses, getOutputClasses
 
Methods inherited from class com.rapidminer.operator.Operator
addError, addValue, addWarning, apply, checkDeprecations, checkForStop, checkIO, checkProperties, clearErrorList, cloneOperator, createExperimentTree, createExperimentTree, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, getAddOnlyAdditionalOutput, getApplyCount, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getEncoding, getErrorList, getExperiment, getInnerOperatorsXML, getInput, getInput, getInput, getInputDescription, getIOContainerForInApplyLoopBreakpoint, getIODescription, getLog, getName, getOperatorClassName, getOperatorDescription, getParameter, getParameterAsBoolean, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsString, getParameterList, getParameters, getParameterType, getParent, getProcess, getStartTime, getStatus, getUserDescription, getValue, getValues, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isEnabled, isExpanded, isParallel, isParameterSet, log, logError, logNote, logWarning, performAdditionalChecks, processFinished, processStarts, register, registerOperator, remove, rename, resume, setApplyCount, setBreakpoint, setEnabled, setExpanded, setInput, setListParameter, setOperatorParameters, setParameter, setParameters, setParent, setUserDescription, toString, unregisterOperator, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_ATTRIBUTE_NAMING_MODE

public static final java.lang.String PARAMETER_ATTRIBUTE_NAMING_MODE
The parameter name for "Determines which attribute properties should be used for attribute naming."

See Also:
Constant Field Values

PARAMETER_HANDLE_VALUE_LABELS

public static final java.lang.String PARAMETER_HANDLE_VALUE_LABELS
The parameter name for "Specifies how to handle attributes with value labels, i.e. whether to ignore the labels or how to use them."

See Also:
Constant Field Values

PARAMETER_SAMPLE_RATIO

public static final java.lang.String PARAMETER_SAMPLE_RATIO
The parameter name for "The fraction of the data set which should be read (1 = all; only used if sample_size = -1)"

See Also:
Constant Field Values

PARAMETER_SAMPLE_SIZE

public static final java.lang.String PARAMETER_SAMPLE_SIZE
The parameter name for "The exact number of samples which should be read (-1 = all; if not -1, sample_ratio will not have any effect)"

See Also:
Constant Field Values

PARAMETER_LOCAL_RANDOM_SEED

public static final java.lang.String PARAMETER_LOCAL_RANDOM_SEED
The parameter name for "Use the given random seed instead of global random numbers (only for permutation, -1: use global)."

See Also:
Constant Field Values

USE_VAR_NAME

public static final int USE_VAR_NAME
Only use variable name as attribute name.

See Also:
Constant Field Values

USE_VAR_LABEL

public static final int USE_VAR_LABEL
Only use variable label as attribute name.

See Also:
Constant Field Values

USE_VAR_NAME_LABELED

public static final int USE_VAR_NAME_LABELED
Use variable name with label in parentheses as attribute name.

See Also:
Constant Field Values

USE_VAR_LABEL_NAMED

public static final int USE_VAR_LABEL_NAMED
Use variable label with name in parentheses as attribute name.

See Also:
Constant Field Values

ATTRIBUTE_NAMING_MODES

public static final java.lang.String[] ATTRIBUTE_NAMING_MODES
String descriptions of attribute naming modes.


FORCE_NUMERIC

public static final int FORCE_NUMERIC
Force attributes to be numeric even if value labels exist.

See Also:
Constant Field Values

IGNORE

public static final int IGNORE
Ignore existing value labels but let attribute be nominal.

See Also:
Constant Field Values

USE_ADDITIONALLY

public static final int USE_ADDITIONALLY
Use existing value labels for labeled values.

See Also:
Constant Field Values

USE_EXCLUSIVELY

public static final int USE_EXCLUSIVELY
Use existing value labels and set all values without labels to unknown.

See Also:
Constant Field Values

HANDLE_VALUE_LABELS_MODES

public static final java.lang.String[] HANDLE_VALUE_LABELS_MODES
String descriptions of value label handling modes.

Constructor Detail

StataExampleSource

public StataExampleSource(OperatorDescription description)
Method Detail

getFileSuffix

protected java.lang.String getFileSuffix()
Description copied from class: BytewiseExampleSource
Returns the suffix of the files which should be read by the input operator.

Specified by:
getFileSuffix in class BytewiseExampleSource

readStream

protected ExampleSet readStream(java.io.InputStream inputStream,
                                DataRowFactory dataRowFactory)
                         throws java.io.IOException,
                                UndefinedParameterError
Description copied from class: BytewiseExampleSource
Reads the given file and constructs an example set from the read data.

Specified by:
readStream in class BytewiseExampleSource
Throws:
java.io.IOException
UndefinedParameterError

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.

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


Copyright © 2001-2009 by Rapid-I