DataType
- The data type for learning. Passed to the wrapped learner.InputType
- The input type for the evaluator.ValueType
- The value type that is the output of learning and is used as the
values in the learned evaluator.public static class DivergencesEvaluator.Learner<DataType,InputType,ValueType> extends AbstractBatchLearnerContainer<BatchLearner<? super DataType,? extends java.util.Collection<ValueType>>> implements BatchLearner<DataType,DivergencesEvaluator<InputType,ValueType>>, DivergenceFunctionContainer<ValueType,InputType>, VectorFactoryContainer
DivergencesEvaluator
. It calls a
base learner and then wraps learned collection of values in an evaluator
that uses the given divergence function.Modifier and Type | Field and Description |
---|---|
protected DivergenceFunction<? super ValueType,? super InputType> |
divergenceFunction
The divergence function to apply between the data and the input.
|
protected VectorFactory<?> |
vectorFactory
The vector factory to use.
|
learner
Constructor and Description |
---|
Learner()
Creates a new
DivergenceFunction.Learner with null base
learner and divergence functions. |
Learner(BatchLearner<DataType,? extends java.util.Collection<ValueType>> learner,
DivergenceFunction<? super ValueType,? super InputType> divergenceFunction)
Creates a new
DivergenceFunction.Learner with the given
properties. |
Learner(BatchLearner<DataType,? extends java.util.Collection<ValueType>> learner,
DivergenceFunction<? super ValueType,? super InputType> divergenceFunction,
VectorFactory<?> vectorFactory)
Creates a new
DivergenceFunction.Learner with the given
properties. |
Modifier and Type | Method and Description |
---|---|
DivergencesEvaluator.Learner<DataType,InputType,ValueType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
static <DataType,InputType,ValueType> |
create(BatchLearner<DataType,? extends java.util.Collection<ValueType>> learner,
DivergenceFunction<? super ValueType,? super InputType> divergenceFunction)
Convenience method for creating a
DivergencesEvaluator.Learner . |
DivergenceFunction<? super ValueType,? super InputType> |
getDivergenceFunction()
Gets the divergence function used by this object.
|
VectorFactory<? extends Vector> |
getVectorFactory()
Gets the vector factory the object to use to create new vectors.
|
DivergencesEvaluator<InputType,ValueType> |
learn(DataType data)
The
learn method creates an object of ResultType using
data of type DataType , using some form of "learning" algorithm. |
void |
setDivergenceFunction(DivergenceFunction<? super ValueType,? super InputType> divergenceFunction)
Sets the divergence function to use from the values to the inputs.
|
void |
setVectorFactory(VectorFactory<?> vectorFactory)
Sets the vector factory to use.
|
getLearner, setLearner
protected DivergenceFunction<? super ValueType,? super InputType> divergenceFunction
protected VectorFactory<?> vectorFactory
public Learner()
DivergenceFunction.Learner
with null base
learner and divergence functions.public Learner(BatchLearner<DataType,? extends java.util.Collection<ValueType>> learner, DivergenceFunction<? super ValueType,? super InputType> divergenceFunction)
DivergenceFunction.Learner
with the given
properties.learner
- The base learner to use.divergenceFunction
- The divergence function to use.public Learner(BatchLearner<DataType,? extends java.util.Collection<ValueType>> learner, DivergenceFunction<? super ValueType,? super InputType> divergenceFunction, VectorFactory<?> vectorFactory)
DivergenceFunction.Learner
with the given
properties.learner
- The base learner to use.divergenceFunction
- The divergence function to use.vectorFactory
- The vector factory to use.public DivergencesEvaluator.Learner<DataType,InputType,ValueType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractBatchLearnerContainer<BatchLearner<? super DataType,? extends java.util.Collection<ValueType>>>
public DivergencesEvaluator<InputType,ValueType> learn(DataType data)
BatchLearner
learn
method creates an object of ResultType
using
data of type DataType
, using some form of "learning" algorithm.learn
in interface BatchLearner<DataType,DivergencesEvaluator<InputType,ValueType>>
data
- The data that the learning algorithm will use to create an
object of ResultType
.public DivergenceFunction<? super ValueType,? super InputType> getDivergenceFunction()
DivergenceFunctionContainer
getDivergenceFunction
in interface DivergenceFunctionContainer<ValueType,InputType>
public void setDivergenceFunction(DivergenceFunction<? super ValueType,? super InputType> divergenceFunction)
divergenceFunction
- The divergence function to use.public VectorFactory<? extends Vector> getVectorFactory()
VectorFactoryContainer
getVectorFactory
in interface VectorFactoryContainer
public void setVectorFactory(VectorFactory<?> vectorFactory)
vectorFactory
- The vector factory to use.public static <DataType,InputType,ValueType> DivergencesEvaluator.Learner<DataType,InputType,ValueType> create(BatchLearner<DataType,? extends java.util.Collection<ValueType>> learner, DivergenceFunction<? super ValueType,? super InputType> divergenceFunction)
DivergencesEvaluator.Learner
.DataType
- The data type for learning. Passed to the wrapped learner.InputType
- The input type for the evaluator.ValueType
- The value type that is the output of learning and is used as the
values in the learned evaluator.learner
- The base learner to use.divergenceFunction
- The divergence function to use.