gov.sandia.cognition.learning.algorithm.ensemble
Class WeightedAdditiveEnsemble<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.AbstractWeightedEnsemble<MemberType>
          extended by gov.sandia.cognition.learning.algorithm.ensemble.WeightedAdditiveEnsemble<InputType,MemberType>
Type Parameters:
InputType - The type of input the ensemble can take. Passed to each ensemble member to produce an output.
MemberType - The type of members of this ensemble.
All Implemented Interfaces:
Evaluator<InputType,Double>, Ensemble<WeightedValue<MemberType>>, Regressor<InputType>, ScalarFunction<InputType>, CloneableSerializable, Serializable, Cloneable

public class WeightedAdditiveEnsemble<InputType,MemberType extends Evaluator<? super InputType,? extends Number>>
extends AbstractWeightedEnsemble<MemberType>
implements Regressor<InputType>

An implementation of an ensemble that takes a weighted sum of the values returned by its members.

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.AbstractWeightedEnsemble
DEFAULT_WEIGHT, members
 
Constructor Summary
WeightedAdditiveEnsemble()
          Creates a new, empty of WeightedAdditiveEnsemble.
WeightedAdditiveEnsemble(List<WeightedValue<MemberType>> members)
          Creates a new instance of WeightedAdditiveEnsemble.
WeightedAdditiveEnsemble(List<WeightedValue<MemberType>> members, double bias)
          Creates a new instance of WeightedAdditiveEnsemble.
 
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.AbstractWeightedEnsemble
add, add, clone, getMemberCount, getMembers, getWeightSum, 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

WeightedAdditiveEnsemble

public WeightedAdditiveEnsemble()
Creates a new, empty of WeightedAdditiveEnsemble.


WeightedAdditiveEnsemble

public WeightedAdditiveEnsemble(List<WeightedValue<MemberType>> members)
Creates a new instance of WeightedAdditiveEnsemble.

Parameters:
members - The members of the ensemble.

WeightedAdditiveEnsemble

public WeightedAdditiveEnsemble(List<WeightedValue<MemberType>> members,
                                double bias)
Creates a new instance of WeightedAdditiveEnsemble.

Parameters:
members - The members of the ensemble.
bias - The initial offset for the result.
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.