DataType
- Type of the input data. Typically an iterable or a collection.ResultType
- Result type from both the online- and batch-learning interfaces.public abstract class AbstractBatchAndIncrementalLearner<DataType,ResultType> extends AbstractCloneableSerializable implements BatchAndIncrementalLearner<DataType,ResultType>
Constructor and Description |
---|
AbstractBatchAndIncrementalLearner()
Creates a new instance of
AbstractBatchAndIncrementalLearner . |
Modifier and Type | Method and Description |
---|---|
AbstractBatchAndIncrementalLearner<DataType,ResultType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
ResultType |
learn(java.util.Collection<? extends DataType> data)
The
learn method creates an object of ResultType using
data of type DataType , using some form of "learning" algorithm. |
ResultType |
learn(java.lang.Iterable<? extends DataType> data)
Creates an object of
ResultType using
data of type DataType , using some form of "learning" algorithm. |
void |
update(ResultType target,
java.lang.Iterable<? extends DataType> data)
The
update method updates an object of ResultType using
the given new Iterable containing some number of type DataType ,
using some form of "learning" algorithm. |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createInitialLearnedObject, update
public AbstractBatchAndIncrementalLearner()
AbstractBatchAndIncrementalLearner
.public AbstractBatchAndIncrementalLearner<DataType,ResultType> 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 AbstractCloneableSerializable
public ResultType learn(java.util.Collection<? extends 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<java.util.Collection<? extends DataType>,ResultType>
data
- The data that the learning algorithm will use to create an
object of ResultType
.public ResultType learn(java.lang.Iterable<? extends DataType> data)
BatchAndIncrementalLearner
ResultType
using
data of type DataType
, using some form of "learning" algorithm.
Typically implemented as a convenience method for calling an incremental
learner on each data point.learn
in interface BatchAndIncrementalLearner<DataType,ResultType>
data
- The data that the learning algorithm will use to create an object
of ResultType
.public void update(ResultType target, java.lang.Iterable<? extends DataType> data)
IncrementalLearner
update
method updates an object of ResultType
using
the given new Iterable containing some number of type DataType
,
using some form of "learning" algorithm.update
in interface IncrementalLearner<DataType,ResultType>
target
- The object to update.data
- The Iterable containing data for the learning algorithm to use to
update the object.