All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.sandia.cognition.learning.algorithm.AbstractSupervisedBatchAndIncrementalLearner Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
/*
 * 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 data)
    {
        // Unpack the pair.
        this.update(target, data.getInput(), data.getOutput());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy