|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.operator.Operator
com.rapidminer.operator.io.AbstractReader<ExampleSet>
com.rapidminer.operator.io.AbstractExampleSource
com.rapidminer.operator.io.ArffExampleSource
public class ArffExampleSource
This operator can read ARFF files known from the machine learning library Weka. An ARFF (Attribute-Relation File Format) file is an ASCII text file that describes a list of instances sharing a set of attributes. ARFF files were developed by the Machine Learning Project at the Department of Computer Science of The University of Waikato for use with the Weka machine learning software.
ARFF files have two distinct sections. The first section is the Header information, which is followed the Data information. The Header of the ARFF file contains the name of the relation (@RELATION, ignored by RapidMiner) and a list of the attributes, each of which is defined by a starting @ATTRIBUTE followed by its name and its type.
Attribute declarations take the form of an orderd sequence of @ATTRIBUTE statements. Each attribute in the data set has its own @ATTRIBUTE statement which uniquely defines the name of that attribute and it's data type. The order the attributes are declared indicates the column position in the data section of the file. For example, if an attribute is the third one declared all that attributes values will be found in the third comma delimited column.
The possible attribute types are:
numericintegerreal{nominalValue1,nominalValue2,...} for nominal attributesstring for nominal attributes without distinct nominal values (it is
however recommended to use the nominal definition above as often as possible)date [date-format] (currently not supported by RapidMiner)Valid examples for attribute definitions are
@ATTRIBUTE petalwidth REAL
@ATTRIBUTE class {Iris-setosa,Iris-versicolor,Iris-virginica}
The ARFF Data section of the file contains the data declaration line @DATA followed
by the actual example data lines. Each example is represented on a single line, with
carriage returns denoting the end of the example. Attribute values for each example
are delimited by commas. They must appear in the order that they were declared in the
header section (i.e. the data corresponding to the n-th @ATTRIBUTE declaration is
always the n-th field of the example line). Missing values are represented by a single
question mark, as in:
4.4,?,1.5,?,Iris-setosa
A percent sign (%) introduces a comment and will be ignored during reading. Attribute names or example values containing spaces must be quoted with single quotes ('). Please note that the sparse ARFF format is currently only supported for numerical attributes. Please use one of the other options for sparse data files provided by RapidMiner if you also need sparse data files for nominal attributes.
Please have a look at the Iris example ARFF file provided in the data subdirectory of the sample directory of RapidMiner to get an idea of the described data format.
| Field Summary | |
|---|---|
static java.lang.String |
PARAMETER_DATA_FILE
The parameter name for "The path to the data file. |
static java.lang.String |
PARAMETER_DATAMANAGEMENT
The parameter name for "Determines, how the data is represented internally. |
static java.lang.String |
PARAMETER_DECIMAL_POINT_CHARACTER
The parameter name for "Character that is used as decimal point. |
static java.lang.String |
PARAMETER_ID_ATTRIBUTE
The parameter name for "The (case sensitive) name of the id attribute" |
static java.lang.String |
PARAMETER_LABEL_ATTRIBUTE
The parameter name for "The (case sensitive) name of the label attribute" |
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 = use sample ratio; if not -1, sample_ratio will not have any effect)" |
static java.lang.String |
PARAMETER_WEIGHT_ATTRIBUTE
The parameter name for "The (case sensitive) name of the weight attribute" |
| Constructor Summary | |
|---|---|
ArffExampleSource(OperatorDescription description)
|
|
| Method Summary | |
|---|---|
ExampleSet |
createExampleSet()
Creates (or reads) the ExampleSet that will be returned by AbstractReader.apply(). |
java.util.List<ParameterType> |
getParameterTypes()
Returns a list of ParameterTypes describing the parameters of this operator. |
| 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PARAMETER_DATA_FILE
public static final java.lang.String PARAMETER_LABEL_ATTRIBUTE
public static final java.lang.String PARAMETER_ID_ATTRIBUTE
public static final java.lang.String PARAMETER_WEIGHT_ATTRIBUTE
public static final java.lang.String PARAMETER_DATAMANAGEMENT
public static final java.lang.String PARAMETER_DECIMAL_POINT_CHARACTER
public static final java.lang.String PARAMETER_SAMPLE_RATIO
public static final java.lang.String PARAMETER_SAMPLE_SIZE
public static final java.lang.String PARAMETER_LOCAL_RANDOM_SEED
| Constructor Detail |
|---|
public ArffExampleSource(OperatorDescription description)
| Method Detail |
|---|
public ExampleSet createExampleSet()
throws OperatorException
AbstractExampleSourceAbstractReader.apply().
createExampleSet in class AbstractExampleSourceOperatorExceptionpublic java.util.List<ParameterType> getParameterTypes()
Operator
getParameterTypes in interface ParameterHandlergetParameterTypes in class Operator
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||