|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.generator.FeatureGenerator
public abstract class FeatureGenerator
Abstract superclass of all attribute generators. Implementing classes have to implement the generate(Example), method and specify the input and output attributes by the appropriate methods so that the using algorithms can use them correctly.
| Field Summary | |
|---|---|
protected Attribute[] |
resultAttributes
The attributes of the function(s) calculated by this FeatureGenerator. |
static int |
SELECTION_MODE_ALL
Indicates a non-restrictive generator selection mode. |
static int |
SELECTION_MODE_RESTRICTIVE
Indicates a restrictive generator selection mode. |
| Constructor Summary | |
|---|---|
FeatureGenerator()
|
|
| Method Summary | |
|---|---|
boolean |
argumentsSet()
returns true, if the arguments have already been set, and false otherwise. |
protected boolean |
checkCompatibility(Attribute attribute,
Attribute compatible,
java.lang.String[] functions)
|
static FeatureGenerator |
createGeneratorForFunction(java.lang.String functionName)
Creates a new FeatureGenerator for a given function name. |
boolean |
equals(java.lang.Object o)
A FeatureGenerator equals another FeatureGenerator if its class is equal and its arguments are equal and its function names are equal. |
abstract void |
generate(DataRow data)
Generates the new attribute values for the example e and returns the new attribute values as doubles. |
static java.util.List<Attribute> |
generateAll(ExampleTable exampleTable,
java.util.Collection<FeatureGenerator> generatorList)
Generates all new attributes and updates the ExampleTable. |
Attribute |
getArgument(int i)
Returns the i-th selected argument (the true index as used in the example set's example table). |
protected ExampleTable |
getExampleTable()
Gets the example table the examples are from. |
abstract java.lang.String |
getFunction()
Sets the function name. |
abstract Attribute[] |
getInputAttributes()
Returns an array of Attributes where the length is the arity of the generator, [i] is the attribute type of the i-th argument. |
abstract java.util.List<Attribute[]> |
getInputCandidates(ExampleSet exampleSet,
java.lang.String[] functions)
Returns all compatible input attribute arrays for this generator from the given example set as list. |
abstract Attribute[] |
getOutputAttributes(ExampleTable input)
Returns the generated attributes types. |
static int |
getSelectionMode()
|
int |
hashCode()
|
abstract FeatureGenerator |
newInstance()
Subclasses must implement this method so that a new instance of this generator class is returned. |
static FeatureGenerator |
selectGenerator(ExampleSet exampleSet,
java.util.List generators,
java.lang.String[] functions,
RandomGenerator random)
Randomly selects a generator from the generator list. |
void |
setArguments(Attribute[] args)
Sets the arguments (indices) used in future generate(...) |
protected void |
setExampleTable(ExampleTable et)
|
abstract void |
setFunction(java.lang.String name)
Sets the function name. |
static void |
setSelectionMode(int mode)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SELECTION_MODE_ALL
public static final int SELECTION_MODE_RESTRICTIVE
protected Attribute[] resultAttributes
| Constructor Detail |
|---|
public FeatureGenerator()
| Method Detail |
|---|
public abstract void generate(DataRow data)
throws GenerationException
GenerationExceptionpublic abstract Attribute[] getInputAttributes()
public abstract Attribute[] getOutputAttributes(ExampleTable input)
public abstract FeatureGenerator newInstance()
public abstract void setFunction(java.lang.String name)
public abstract java.lang.String getFunction()
public abstract java.util.List<Attribute[]> getInputCandidates(ExampleSet exampleSet,
java.lang.String[] functions)
protected boolean checkCompatibility(Attribute attribute,
Attribute compatible,
java.lang.String[] functions)
protected void setExampleTable(ExampleTable et)
protected ExampleTable getExampleTable()
public void setArguments(Attribute[] args)
public boolean argumentsSet()
public Attribute getArgument(int i)
public static FeatureGenerator createGeneratorForFunction(java.lang.String functionName)
public static FeatureGenerator selectGenerator(ExampleSet exampleSet,
java.util.List generators,
java.lang.String[] functions,
RandomGenerator random)
getInputCandidates(ExampleSet, String[]) method. Returns
null if no generators are applicable.
generators - List of FeatureGenerators
public static java.util.List<Attribute> generateAll(ExampleTable exampleTable,
java.util.Collection<FeatureGenerator> generatorList)
throws GenerationException
exampleTable - the source example tablegeneratorList - List of FeatureGenerators
GenerationExceptionpublic static int getSelectionMode()
public static void setSelectionMode(int mode)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||