|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.example.ExampleSetFactory
public class ExampleSetFactory
This class can be used to easily create @link ExampleSet}s and the underlying
ExampleTable with simple method calls. Please note that it is often better
to explicitly fill the data table yourself, or, if possible, to extend ExampleTable
or DataRow to provide the necessary data to RapidMiner. For memory usage reasons,
it is also often not recommended to create the data matrix from your existing data
in an extra step and then use one of the factory methods. In these cases, it is better
to directly fill an ExampleTable from your data source.
However, in some cases it might be more convenient to use this class in order to
create example sets from data matrices in a fast and simple way. The resulting example
set will be backed up by a MemoryExampleTable. If the data set
at hand is completely numerical, one can simply use one of the double matrix methods
provided by this class. This will lead to an ExampleSet containing only numerical
attributes. Otherwise, one have to use the Object matrix methods. Please
note that only String objects and Number objects (Double, Integer) are allowed in this
case. Otherwise an Exception will be thrown. In case of the Object matrix methods the
method tries to identify the type itself and initialized the example set with the
correct attribute types (nominal or numerical).
Please note that the internal representation of the nominal attribute values depend on the order they appear in the data set. If this is not allowed (e.g. for the label attribute of different training and testing sets, where the internal representation should be the same in order to prevent label flips) one should definitely use the usual ExampleTable - ExampleSet construction where the nominal attribute value mapping can and should be performed beforehand. In these cases the usage of this class is definitely not recommended.
| Constructor Summary | |
|---|---|
ExampleSetFactory()
|
|
| Method Summary | |
|---|---|
static ExampleSet |
createExampleSet(double[][] data)
Create a numerical example set from the given data matrix. |
static ExampleSet |
createExampleSet(double[][] data,
double[] labels)
Create a numerical example set from the given data matrix. |
static ExampleSet |
createExampleSet(double[][] data,
int classColumn)
Create a numerical example set from the given data matrix. |
static ExampleSet |
createExampleSet(java.lang.Object[][] data)
Create a mixed-type example set from the given data matrix. |
static ExampleSet |
createExampleSet(java.lang.Object[][] data,
int classColumn)
Create a numerical example set from the given data matrix. |
static ExampleSet |
createExampleSet(java.lang.Object[][] data,
java.lang.Object[] labels)
Create a numerical example set from the given data matrix. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExampleSetFactory()
| Method Detail |
|---|
public static ExampleSet createExampleSet(double[][] data)
public static ExampleSet createExampleSet(double[][] data,
int classColumn)
public static ExampleSet createExampleSet(double[][] data,
double[] labels)
public static ExampleSet createExampleSet(java.lang.Object[][] data)
public static ExampleSet createExampleSet(java.lang.Object[][] data,
int classColumn)
public static ExampleSet createExampleSet(java.lang.Object[][] data,
java.lang.Object[] labels)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||