gov.sandia.cognition.learning.algorithm.ensemble
Class AdditiveEnsemble<InputType,MemberType extends Evaluator<? super InputType,? extends Number>>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.ensemble.AbstractUnweightedEnsemble<MemberType>
          extended by gov.sandia.cognition.learning.algorithm.ensemble.AdditiveEnsemble<InputType,MemberType>
Type Parameters:
InputType - The type of input to the ensemble. Passed to each ensemble member regression function to produce an output.
MemberType - The type of members of the ensemble, which must be evaluators that return numbers.
All Implemented Interfaces:
Evaluator<InputType,Double>, Ensemble<MemberType>, Regressor<InputType>, ScalarFunction<InputType>, CloneableSerializable, Serializable, Cloneable

public class AdditiveEnsemble<InputType,MemberType extends Evaluator<? super InputType,? extends Number>>
extends AbstractUnweightedEnsemble<MemberType>
implements Regressor<InputType>

An ensemble of regression functions that determine the result by adding their outputs together.

Since:
3.3.3
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  double bias
          The initial offset value that the ensemble outputs are added to.
static double DEFAULT_BIAS
          The default bias is 0.0.
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.ensemble.AbstractUnweightedEnsemble
members
 
Constructor Summary
AdditiveEnsemble()
          Creates a new, empty AdditiveEnsemble.
AdditiveEnsemble(List<MemberType> members)
          Creates a new AdditiveEnsemble with the given members and a bias of 0.
AdditiveEnsemble(List<MemberType> members, double bias)
          Creates a new AdditiveEnsemble with the given members.
 
Method Summary
 Double evaluate(InputType input)
          Evaluates the function on the given input and returns the output.
 double evaluateAsDouble(InputType input)
          Evaluates the scalar function as a double.
 double getBias()
          Gets the initial offset value (bias) to which the output of the ensemble members are added when computing a result.
 void setBias(double bias)
          Sets the initial offset value (bias) to which the output of the ensemble members are added when computing a result.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.ensemble.AbstractUnweightedEnsemble
add, clone, getMemberCount, getMembers, setMembers
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BIAS

public static final double DEFAULT_BIAS
The default bias is 0.0.

See Also:
Constant Field Values

bias

protected double bias
The initial offset value that the ensemble outputs are added to.

Constructor Detail

AdditiveEnsemble

public AdditiveEnsemble()
Creates a new, empty AdditiveEnsemble.


AdditiveEnsemble

public AdditiveEnsemble(List<MemberType> members)
Creates a new AdditiveEnsemble with the given members and a bias of 0.

Parameters:
members - The list of ensemble members.

AdditiveEnsemble

public AdditiveEnsemble(List<MemberType> members,
                        double bias)
Creates a new AdditiveEnsemble with the given members.

Parameters:
members - The list of ensemble members.
bias - The initial offset value.
Method Detail

evaluate

public Double evaluate(InputType input)
Description copied from interface: Evaluator
Evaluates the function on the given input and returns the output.

Specified by:
evaluate in interface Evaluator<InputType,Double>
Parameters:
input - The input to evaluate.
Returns:
The output produced by evaluating the input.

evaluateAsDouble

public double evaluateAsDouble(InputType input)
Description copied from interface: ScalarFunction
Evaluates the scalar function as a double.

Specified by:
evaluateAsDouble in interface ScalarFunction<InputType>
Parameters:
input - The input value.
Returns:
The scalar output calculated from the given input.

getBias

public double getBias()
Gets the initial offset value (bias) to which the output of the ensemble members are added when computing a result.

Returns:
The bias.

setBias

public void setBias(double bias)
Sets the initial offset value (bias) to which the output of the ensemble members are added when computing a result.

Parameters:
bias - The bias.