DataType - Type of data to use.ResultType - Type of result to return.LearnerType - Type of BatchLearner to use.public class ParameterAdaptableBatchLearnerWrapper<DataType,ResultType,LearnerType extends BatchLearner<? super DataType,? extends ResultType>> extends AbstractBatchLearnerContainer<LearnerType> implements BatchLearner<DataType,ResultType>, ParameterAdaptable<LearnerType,DataType>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.LinkedList<ParameterAdapter<? super LearnerType,? super DataType>> |
parameterAdapters
The list of parameter adapters for the learner.
|
learner| Constructor and Description |
|---|
ParameterAdaptableBatchLearnerWrapper()
Creates a new
ParameterAdaptableBatchLearnerWrapper. |
ParameterAdaptableBatchLearnerWrapper(LearnerType learner)
Creates a new
ParameterAdaptableBatchLearnerWrapper. |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameterAdapter(ParameterAdapter<? super LearnerType,? super DataType> parameterAdapter)
Adds the given parameter adapter to this object.
|
ParameterAdaptableBatchLearnerWrapper<DataType,ResultType,LearnerType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
static <DataType,ResultType,LearnerType extends BatchLearner<? super DataType,? extends ResultType>> |
create(LearnerType learner)
A convenience method for creating the wrapper for a learner.
|
java.util.LinkedList<ParameterAdapter<? super LearnerType,? super DataType>> |
getParameterAdapters()
Gets the collection of parameter adapters attached to this object.
|
ResultType |
learn(DataType data)
The
learn method creates an object of ResultType using
data of type DataType, using some form of "learning" algorithm. |
void |
removeParameterAdapter(ParameterAdapter<? super LearnerType,? super DataType> parameterAdapter)
Removes the given parameter adapter from this object.
|
void |
setParameterAdapters(java.util.LinkedList<ParameterAdapter<? super LearnerType,? super DataType>> parameterAdapters)
Sets the list of parameter adapters for the learning algorithm.
|
getLearner, setLearnerprotected java.util.LinkedList<ParameterAdapter<? super LearnerType extends BatchLearner<? super DataType,? extends ResultType>,? super DataType>> parameterAdapters
public ParameterAdaptableBatchLearnerWrapper()
ParameterAdaptableBatchLearnerWrapper.public ParameterAdaptableBatchLearnerWrapper(LearnerType learner)
ParameterAdaptableBatchLearnerWrapper.learner - The learner whose parameters are to be adapted.public ParameterAdaptableBatchLearnerWrapper<DataType,ResultType,LearnerType> clone()
AbstractCloneableSerializableObject 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 CloneableSerializableclone in class AbstractBatchLearnerContainer<LearnerType extends BatchLearner<? super DataType,? extends ResultType>>public ResultType learn(DataType data)
BatchLearnerlearn method creates an object of ResultType using
data of type DataType, using some form of "learning" algorithm.learn in interface BatchLearner<DataType,ResultType>data - The data that the learning algorithm will use to create an
object of ResultType.public void addParameterAdapter(ParameterAdapter<? super LearnerType,? super DataType> parameterAdapter)
ParameterAdaptableaddParameterAdapter in interface ParameterAdaptable<LearnerType extends BatchLearner<? super DataType,? extends ResultType>,DataType>parameterAdapter - The parameter adapter to add.public void removeParameterAdapter(ParameterAdapter<? super LearnerType,? super DataType> parameterAdapter)
ParameterAdaptableremoveParameterAdapter in interface ParameterAdaptable<LearnerType extends BatchLearner<? super DataType,? extends ResultType>,DataType>parameterAdapter - The parameter adapter to remove.public java.util.LinkedList<ParameterAdapter<? super LearnerType,? super DataType>> getParameterAdapters()
ParameterAdaptablegetParameterAdapters in interface ParameterAdaptable<LearnerType extends BatchLearner<? super DataType,? extends ResultType>,DataType>public void setParameterAdapters(java.util.LinkedList<ParameterAdapter<? super LearnerType,? super DataType>> parameterAdapters)
parameterAdapters - The list of parameter adapters for the learning algorithm.public static <DataType,ResultType,LearnerType extends BatchLearner<? super DataType,? extends ResultType>> ParameterAdaptableBatchLearnerWrapper<DataType,ResultType,LearnerType> create(LearnerType learner)
DataType - Type of data to use.ResultType - Type of result to return.LearnerType - Type of BatchLearner to use.learner - The learner whose parameters are to be adapted.