com.rapidminer.tools.math.function.aggregation
Class AbstractAggregationFunction

java.lang.Object
  extended by com.rapidminer.tools.math.function.aggregation.AbstractAggregationFunction
All Implemented Interfaces:
AggregationFunction
Direct Known Subclasses:
AverageFunction, CountFunction, MaxFunction, MedianFunction, MinFunction, ModeFunction, SumFunction, VarianceFunction

public abstract class AbstractAggregationFunction
extends java.lang.Object
implements AggregationFunction

Superclass for aggregation functions providing some generic functions.

Author:
Tobias Malbrecht

Field Summary
static int AVERAGE
           
static int COUNT
           
static boolean DEFAULT_IGNORE_MISSINGS
           
protected  boolean foundMissing
           
protected  boolean ignoreMissings
           
static java.lang.String[] KNOWN_AGGREGATION_FUNCTION_NAMES
           
static java.lang.Class[] KNOWN_AGGREGATION_FUNCTIONS
           
static int MAXIMUM
           
static int MEDIAN
           
static int MINIMUM
           
static int MODE
           
static int STANDARD_DEVIATION
           
static int SUM
           
static int VARIANCE
           
 
Constructor Summary
AbstractAggregationFunction()
           
AbstractAggregationFunction(java.lang.Boolean ignoreMissings)
           
 
Method Summary
 double calculate(double[] values)
          Resets the counters and computes the aggregation function solely based on the given values.
 double calculate(double[] values, double[] weights)
          Resets the counters and computes the aggregation function solely based on the given values and the given weights.
static AggregationFunction createAggregationFunction(int typeIndex)
           
static AggregationFunction createAggregationFunction(int typeIndex, boolean ignoreMissings)
           
static AggregationFunction createAggregationFunction(java.lang.String functionName)
           
static AggregationFunction createAggregationFunction(java.lang.String functionName, boolean ignoreMissings)
           
protected abstract  void reset()
          Reset the counters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rapidminer.tools.math.function.aggregation.AggregationFunction
getName, getValue, supportsAttribute, update, update
 

Field Detail

KNOWN_AGGREGATION_FUNCTIONS

public static final java.lang.Class[] KNOWN_AGGREGATION_FUNCTIONS

KNOWN_AGGREGATION_FUNCTION_NAMES

public static final java.lang.String[] KNOWN_AGGREGATION_FUNCTION_NAMES

AVERAGE

public static final int AVERAGE
See Also:
Constant Field Values

VARIANCE

public static final int VARIANCE
See Also:
Constant Field Values

STANDARD_DEVIATION

public static final int STANDARD_DEVIATION
See Also:
Constant Field Values

COUNT

public static final int COUNT
See Also:
Constant Field Values

MINIMUM

public static final int MINIMUM
See Also:
Constant Field Values

MAXIMUM

public static final int MAXIMUM
See Also:
Constant Field Values

SUM

public static final int SUM
See Also:
Constant Field Values

MODE

public static final int MODE
See Also:
Constant Field Values

MEDIAN

public static final int MEDIAN
See Also:
Constant Field Values

DEFAULT_IGNORE_MISSINGS

public static final boolean DEFAULT_IGNORE_MISSINGS
See Also:
Constant Field Values

ignoreMissings

protected boolean ignoreMissings

foundMissing

protected boolean foundMissing
Constructor Detail

AbstractAggregationFunction

public AbstractAggregationFunction()

AbstractAggregationFunction

public AbstractAggregationFunction(java.lang.Boolean ignoreMissings)
Method Detail

createAggregationFunction

public static AggregationFunction createAggregationFunction(java.lang.String functionName,
                                                            boolean ignoreMissings)
                                                     throws java.lang.InstantiationException,
                                                            java.lang.IllegalAccessException,
                                                            java.lang.ClassNotFoundException,
                                                            java.lang.NoSuchMethodException,
                                                            java.lang.reflect.InvocationTargetException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException

createAggregationFunction

public static AggregationFunction createAggregationFunction(java.lang.String functionName)
                                                     throws java.lang.InstantiationException,
                                                            java.lang.IllegalAccessException,
                                                            java.lang.ClassNotFoundException,
                                                            java.lang.NoSuchMethodException,
                                                            java.lang.reflect.InvocationTargetException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException

createAggregationFunction

public static AggregationFunction createAggregationFunction(int typeIndex,
                                                            boolean ignoreMissings)
                                                     throws java.lang.InstantiationException,
                                                            java.lang.IllegalAccessException,
                                                            java.lang.NoSuchMethodException,
                                                            java.lang.reflect.InvocationTargetException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException

createAggregationFunction

public static AggregationFunction createAggregationFunction(int typeIndex)
                                                     throws java.lang.InstantiationException,
                                                            java.lang.IllegalAccessException,
                                                            java.lang.NoSuchMethodException,
                                                            java.lang.reflect.InvocationTargetException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException

reset

protected abstract void reset()
Reset the counters.


calculate

public double calculate(double[] values)
Resets the counters and computes the aggregation function solely based on the given values.

Specified by:
calculate in interface AggregationFunction

calculate

public double calculate(double[] values,
                        double[] weights)
Resets the counters and computes the aggregation function solely based on the given values and the given weights.

Specified by:
calculate in interface AggregationFunction


Copyright © 2001-2009 by Rapid-I