|
||||||||||
| 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.OperatorChain
com.rapidminer.operator.preprocessing.AttributeSubsetPreprocessing
public class AttributeSubsetPreprocessing
This operator can be used to select one attribute (or a subset) by defining a regular expression for the attribute name and applies its inner operators to the resulting subset. Please note that this operator will also use special attributes which makes it necessary for all preprocessing steps which should be performed on special attributes (and are normally not performed on special attributes).
This operator is also able to deliver the additional results of the inner operator if desired.
Afterwards, the remaining original attributes are added to the resulting example set if the parameter "keep_subset_only" is set to false (default).
Please note that this operator is very powerful and can be used to create new preprocessing schemes by combinating it with other preprocessing operators. Hoewever, there are two major restrictions (among some others): first, since the inner result will be combined with the rest of the input example set, the number of examples (data points) is not allowed to be changed inside of the subset preprocessing. Second, attribute role changes will not be delivered to the outside since internally all special attributes will be changed to regular for the inner operators and role changes can afterwards not be delivered.
| Field Summary | |
|---|---|
static java.lang.String |
PARAMETER_ATTRIBUTE_NAME_REGEX
The parameter name for "A regular expression which matches against all attribute names (including special attributes). |
static java.lang.String |
PARAMETER_DELIVER_INNER_RESULTS
The parameter name for "Indicates if the additional results (other than example set) of the inner operator should also be returned. |
static java.lang.String |
PARAMETER_INVERT_SELECTION
The parameter name for "Indicates if the attributes which did not match the regular expression should be removed by this operator. |
static java.lang.String |
PARAMETER_KEEP_SUBSET_ONLY
The parameter name for "Indicates if the attributes which did not match the regular expression should be removed by this operator. |
static java.lang.String |
PARAMETER_PROCESS_SPECIAL_ATTRIBUTES
The parameter name for "Indicates if special attributes like labels etc. should also be processed. |
| Constructor Summary | |
|---|---|
AttributeSubsetPreprocessing(OperatorDescription description)
|
|
| Method Summary | |
|---|---|
IOObject[] |
apply()
Applies all inner operators. |
java.lang.Class<?>[] |
checkIO(java.lang.Class<?>[] input)
Subclasses will throw an exception if something isn't ok. |
InnerOperatorCondition |
getInnerOperatorCondition()
Must return a condition of the IO behaviour of all desired inner operators. |
java.lang.Class<?>[] |
getInputClasses()
Returns the classes that are needed as input. |
protected IODescription |
getIODescription()
If you find the getInputClasses() and getOuputClasses() methods for some reason not useful, you may override this method. |
int |
getMaxNumberOfInnerOperators()
Returns the maximum number of inner operators. |
int |
getMinNumberOfInnerOperators()
Returns the minimum number of inner operators. |
java.lang.Class<?>[] |
getOutputClasses()
Returns the classes that are guaranteed to be returned by apply() as additional output. |
java.util.List<ParameterType> |
getParameterTypes()
Returns a list of ParameterTypes describing the parameters of this operator. |
protected boolean |
shouldAddNonConsumedInput()
|
| 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_ATTRIBUTE_NAME_REGEX
public static final java.lang.String PARAMETER_INVERT_SELECTION
public static final java.lang.String PARAMETER_PROCESS_SPECIAL_ATTRIBUTES
public static final java.lang.String PARAMETER_DELIVER_INNER_RESULTS
public static final java.lang.String PARAMETER_KEEP_SUBSET_ONLY
| Constructor Detail |
|---|
public AttributeSubsetPreprocessing(OperatorDescription description)
| Method Detail |
|---|
public IOObject[] apply()
throws OperatorException
OperatorChain
apply in class OperatorChainOperatorExceptionpublic int getMaxNumberOfInnerOperators()
OperatorChain
getMaxNumberOfInnerOperators in class OperatorChainpublic int getMinNumberOfInnerOperators()
OperatorChain
getMinNumberOfInnerOperators in class OperatorChainpublic java.lang.Class<?>[] getInputClasses()
OperatorOperator.getOutputClasses() and
Operator.apply() if this is necessary. This default behavior can be
changed by overriding Operator.getInputDescription(Class). Subclasses
which implement this method should not make use of parameters since this
method is invoked by getParameterTypes(). Therefore, parameters are not
fully available at this point of time and this might lead to exceptions.
Please use InputDescriptions instead.
getInputClasses in class Operatorpublic java.lang.Class<?>[] getOutputClasses()
OperatorReturns the classes that are guaranteed to be returned by
apply() as additional output. Please note that input objects
which should not be consumed must also be defined by this method (e.g.
an example set which is changed but not consumed in the case of a preprocessing
operator must be defined in both, the methods Operator.getInputClasses() and
Operator.getOutputClasses()). The default behavior for input consumation
is defined by Operator.getInputDescription(Class) and can be changed by
overwriting this method. Objects which are not consumed (defined by changing
the implementation in Operator.getInputDescription(Class)) must not be
defined as additional output in this method.
May deliver null or an empy array (no additional output is produced or guaranteed). Must return the class array of delivered output objects otherwise.
getOutputClasses in class Operatorpublic InnerOperatorCondition getInnerOperatorCondition()
OperatorChainSimpleChainInnerOperatorCondition. More than one
condition should be combined with help of the class
CombinedInnerOperatorCondition.
getInnerOperatorCondition in class OperatorChain
public java.lang.Class<?>[] checkIO(java.lang.Class<?>[] input)
throws IllegalInputException,
WrongNumberOfInnerOperatorsException
checkIO in class OperatorChainIllegalInputException
WrongNumberOfInnerOperatorsExceptionprotected IODescription getIODescription()
Operator
getIODescription in class Operatorprotected boolean shouldAddNonConsumedInput()
shouldAddNonConsumedInput in class OperatorChainpublic 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 | |||||||||