ValueType - The type of the constant value returned as the result of learning.public class ConstantLearner<ValueType> extends AbstractCloneableSerializable implements BatchLearner<java.lang.Object,ValueType>
| Modifier and Type | Field and Description |
|---|---|
protected ValueType |
value
The result of learning.
|
| Constructor and Description |
|---|
ConstantLearner()
Creates a new
ConstantLearner with a null value. |
ConstantLearner(ValueType value)
Creates a new
ConstantLearner with the given value; |
| Modifier and Type | Method and Description |
|---|---|
static <ValueType> |
create(ValueType value)
Creates a new
ConstantLearner. |
ValueType |
getValue()
Gets the value that is the result of learning.
|
ValueType |
learn(java.lang.Object data)
The
learn method creates an object of ResultType using
data of type DataType, using some form of "learning" algorithm. |
void |
setValue(ValueType value)
Sets the value that is the result of learning.
|
cloneequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloneprotected ValueType value
public ConstantLearner()
ConstantLearner with a null value.public ConstantLearner(ValueType value)
ConstantLearner with the given value;value - The value that is used as the result of learning.public ValueType learn(java.lang.Object data)
BatchLearnerlearn method creates an object of ResultType using
data of type DataType, using some form of "learning" algorithm.learn in interface BatchLearner<java.lang.Object,ValueType>data - The data that the learning algorithm will use to create an
object of ResultType.public ValueType getValue()
public void setValue(ValueType value)
value - The value that is the result of learning.public static <ValueType> ConstantLearner<ValueType> create(ValueType value)
ConstantLearner.ValueType - The type of value that is the result of learning.value - The value that is the result of learning.ConstantLearner for the given value.