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.public class WeightedAveragingEnsemble<InputType,MemberType extends Evaluator<? super InputType,? extends java.lang.Number>> extends AbstractWeightedEnsemble<MemberType> implements Regressor<InputType>
DEFAULT_WEIGHT, members
Constructor and Description |
---|
WeightedAveragingEnsemble()
Creates a new, empty of
WeightedAveragingEnsemble . |
WeightedAveragingEnsemble(java.util.List<WeightedValue<MemberType>> members)
Creates a new instance of
WeightedAveragingEnsemble . |
Modifier and Type | Method and Description |
---|---|
void |
add(MemberType member,
double weight)
Adds the given regression function with a given weight.
|
java.lang.Double |
evaluate(InputType input)
Returns the result of calling
evaluateAsDouble . |
double |
evaluateAsDouble(InputType input)
Evaluates the scalar function as a double.
|
add, clone, getMemberCount, getMembers, getWeightSum, setMembers
public WeightedAveragingEnsemble()
WeightedAveragingEnsemble
.public WeightedAveragingEnsemble(java.util.List<WeightedValue<MemberType>> members)
WeightedAveragingEnsemble
.members
- The members of the ensemble.public void add(MemberType member, double weight)
AbstractWeightedEnsemble
add
in class AbstractWeightedEnsemble<MemberType extends Evaluator<? super InputType,? extends java.lang.Number>>
member
- The regression function to add.weight
- The weight for the new member.public java.lang.Double evaluate(InputType input)
ScalarFunction
evaluateAsDouble
.public double evaluateAsDouble(InputType input)
ScalarFunction
evaluateAsDouble
in interface ScalarFunction<InputType>
input
- The input value.