gov.sandia.cognition.learning.algorithm.AbstractSupervisedBatchAndIncrementalLearner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cognitive-foundry Show documentation
Show all versions of cognitive-foundry Show documentation
A single jar with all the Cognitive Foundry components.
/*
* File: AbstractSupervisedBatchAndIncrementalLearner.java
* Authors: Justin Basilico
* Company: Sandia National Laboratories
* Project: Cognitive Foundry Learning Core
*
* Copyright March 31, 2011, Sandia Corporation.
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the U.S. Government. Export
* of this program may require a license from the United States Government.
*/
package gov.sandia.cognition.learning.algorithm;
import gov.sandia.cognition.evaluator.Evaluator;
import gov.sandia.cognition.learning.data.InputOutputPair;
/**
* An abstract implementation of the batch and incremental learning for
* an incremental supervised learner.
*
* @param The type of input data in the input-output pair that
* the learner can learn from. The {@code Evaluator} learned from the
* algorithm also takes this as the input parameter.
* @param The type of output data in the input-output pair that
* the learner can learn from. The {@code Evaluator} learned from the
* algorithm also produces this as its output.
* @param The type of object created by the learning algorithm.
* For example, a {@code LinearBinaryCategorizer}.
* @author Justin Basilico
* @since 3.2.0
*/
public abstract class AbstractSupervisedBatchAndIncrementalLearner>
extends AbstractBatchAndIncrementalLearner, ResultType>
implements SupervisedBatchAndIncrementalLearner
{
/**
* Creates a new {@code AbstractSupervisedBatchAndIncrementalLearner}.
*/
public AbstractSupervisedBatchAndIncrementalLearner()
{
super();
}
@Override
public void update(
final ResultType target,
final InputOutputPair extends InputType, OutputType> data)
{
// Unpack the pair.
this.update(target, data.getInput(), data.getOutput());
}
}