|
||||||||||
| 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.performance.AbstractPerformanceEvaluator
public abstract class AbstractPerformanceEvaluator
This performance evaluator operator should be used for regression tasks,
i.e. in cases where the label attribute has a numerical value type.
The operator expects a test ExampleSet
as input, whose elements have both true and predicted labels, and delivers as
output a list of performance values according to a list of performance
criteria that it calculates. If an input performance vector was already
given, this is used for keeping the performance values.
All of the performance criteria can be switched on using boolean parameters.
Their values can be queried by a
ProcessLogOperator using the same names.
The main criterion is used for comparisons and need to be specified only for
processes where performance vectors are compared, e.g. feature selection
or other meta optimization process setups.
If no other main criterion was selected, the first criterion in the
resulting performance vector will be assumed to be the main criterion.
The resulting performance vectors are usually compared with a standard
performance comparator which only compares the fitness values of the main
criterion. Other implementations than this simple comparator can be
specified using the parameter comparator_class. This may for
instance be useful if you want to compare performance vectors according to
the weighted sum of the individual criteria. In order to implement your own
comparator, simply subclass PerformanceComparator. Please note that
for true multi-objective optimization usually another selection scheme is
used instead of simply replacing the performance comparator.
| Field Summary | |
|---|---|
static java.lang.String |
PARAMETER_COMPARATOR_CLASS
The parameter name for "Fully qualified classname of the PerformanceComparator implementation. |
static java.lang.String |
PARAMETER_MAIN_CRITERION
The parameter name for "The criterion used for comparing performance vectors. |
static java.lang.String |
PARAMETER_SKIP_UNDEFINED_LABELS
The parameter name for "If set to true, examples with undefined labels are skipped. |
| Constructor Summary | |
|---|---|
AbstractPerformanceEvaluator(OperatorDescription description)
|
|
| Method Summary | |
|---|---|
IOObject[] |
apply()
Implement this method in subclasses. |
protected abstract void |
checkCompatibility(ExampleSet exampleSet)
Performs a check if this operator can be used for this type of exampel set at all. |
static void |
evaluate(AbstractPerformanceEvaluator evaluator,
ExampleSet testSet,
PerformanceVector performanceCriteria,
java.util.List<PerformanceCriterion> givenCriteria,
boolean skipUndefinedLabels,
boolean useExampleWeights)
Static version of evaluate(ExampleSet,PerformanceVector). |
protected PerformanceVector |
evaluate(ExampleSet testSet,
PerformanceVector inputPerformance)
Evaluates the given test set. |
protected abstract double[] |
getClassWeights(Attribute label)
Delivers class weights for performance criteria which implement the ClassWeightedPerformance interface. |
abstract java.util.List<PerformanceCriterion> |
getCriteria()
Delivers the list of criteria which is able for this operator. |
java.lang.Class<?>[] |
getInputClasses()
Returns the classes that are needed as input. |
InputDescription |
getInputDescription(java.lang.Class cls)
Shows a parameter keep_example_set with default value "false". |
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 void |
init(ExampleSet exampleSet)
This method will be invoked before the actual calculation is started. |
protected boolean |
showComparatorParameter()
Subclasses might override this method and return false. |
protected boolean |
showCriteriaParameter()
Subclasses might override this method and return false. |
protected boolean |
showSkipNaNLabelsParameter()
Subclasses might override this method and return false. |
| 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_MAIN_CRITERION
public static final java.lang.String PARAMETER_SKIP_UNDEFINED_LABELS
public static final java.lang.String PARAMETER_COMPARATOR_CLASS
| Constructor Detail |
|---|
public AbstractPerformanceEvaluator(OperatorDescription description)
| Method Detail |
|---|
public abstract java.util.List<PerformanceCriterion> getCriteria()
protected abstract double[] getClassWeights(Attribute label)
throws UndefinedParameterError
ClassWeightedPerformance interface. Might return null (for example
for regression task performance evaluators).
UndefinedParameterError
protected abstract void checkCompatibility(ExampleSet exampleSet)
throws OperatorException
OperatorExceptionprotected void init(ExampleSet exampleSet)
protected boolean showSkipNaNLabelsParameter()
protected boolean showComparatorParameter()
protected boolean showCriteriaParameter()
public IOObject[] apply()
throws OperatorException
Operator
apply in class OperatorOperatorException
protected PerformanceVector evaluate(ExampleSet testSet,
PerformanceVector inputPerformance)
throws OperatorException
PerformanceCriterion instances
in the given PerformanceVector must be subclasses of
MeasuredPerformance.
OperatorException
public static void evaluate(AbstractPerformanceEvaluator evaluator,
ExampleSet testSet,
PerformanceVector performanceCriteria,
java.util.List<PerformanceCriterion> givenCriteria,
boolean skipUndefinedLabels,
boolean useExampleWeights)
throws OperatorException
evaluate(ExampleSet,PerformanceVector). This
method was introduced to enable testing of the method.
evaluator - Ususally this. May be null for testing. Only needed for
exception.
OperatorExceptionpublic InputDescription getInputDescription(java.lang.Class cls)
getInputDescription in class Operatorpublic 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 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 | |||||||||