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

gov.sandia.cognition.learning.algorithm.perceptron.KernelizableBinaryCategorizerOnlineLearner Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
/*
 * File:                KernelizableBinaryCategorizerOnlineLearner.java
 * Authors:             Justin Basilico
 * Company:             Sandia National Laboratories
 * Project:             Cognitive Foundry Learning Core
 * 
 * Copyright April 04, 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.perceptron;

import gov.sandia.cognition.learning.algorithm.SupervisedBatchAndIncrementalLearner;
import gov.sandia.cognition.learning.data.InputOutputPair;
import gov.sandia.cognition.learning.function.categorization.DefaultKernelBinaryCategorizer;
import gov.sandia.cognition.learning.function.categorization.LinearBinaryCategorizer;
import gov.sandia.cognition.learning.function.kernel.Kernel;
import gov.sandia.cognition.math.matrix.Vectorizable;

/**
 * Interface for an online learner of a linear binary categorizer that can also
 * be used with a kernel function. Thus, there are a second set of methods
 * that are similar to the ones for the normal learner that are specifically
 * for kernel learning. The companion to this class is
 * {@code LinearizableBinaryCategorizerOnlineLearner}.
 * 
 * @author  Justin Basilico
 * @since   3.3.0
 * @see     LinearizableBinaryCategorizerOnlineLearner
 */
public interface KernelizableBinaryCategorizerOnlineLearner
    extends SupervisedBatchAndIncrementalLearner
{

    /**
     * Creates the initial learned object with a given kernel.
     *
     * @param   
     *      The input type for supervised learning. Will be passed to the
     *      kernel function.
     * @param   kernel
     *      The kernel function to use.
     * @return
     *      A new, empty learned object.
     */
    public  DefaultKernelBinaryCategorizer createInitialLearnedObject(
        final Kernel kernel);

    /**
     * Performs a kernel-based incremental update step on the given object
     * using the given supervised data.
     *
     * @param   
     *      The input type for supervised learning. Will be passed to the
     *      kernel function.
     * @param   target
     *      The target object to update.
     * @param   data
     *      The supervised training data.
     */
    public  void update(
        final DefaultKernelBinaryCategorizer target,
        final Iterable> data);
    
    /**
     * Performs a kernel-based incremental update step on the given object
     * using the given supervised data.
     *
     * @param   
     *      The input type for supervised learning. Will be passed to the
     *      kernel function.
     * @param   target
     *      The target object to update.
     * @param   data
     *      The supervised training data.
     */
    public  void update(
        final DefaultKernelBinaryCategorizer target,
        final InputOutputPair data);
    
    /**
     * Performs a kernel-based incremental update step on the given object
     * using the given supervised data.
     *
     * @param   
     *      The input type for supervised learning. Will be passed to the
     *      kernel function.
     * @param   target
     *      The target object to update.
     * @param   input
     *      The supervised input value.
     * @param   output
     *      The supervised output value (label).
     */
    public  void update(
        final DefaultKernelBinaryCategorizer target,
        final InputType input,
        final Boolean output);

    /**
     * Performs a kernel-based incremental update step on the given object
     * using the given supervised data.
     *
     * @param   
     *      The input type for supervised learning. Will be passed to the
     *      kernel function.
     * @param   target
     *      The target object to update.
     * @param   input
     *      The supervised input value.
     * @param   output
     *      The supervised output value (label).
     */
    public  void update(
        final DefaultKernelBinaryCategorizer target,
        final InputType input,
        final boolean output);

    /**
     * Run this algorithm on a batch of data using the given kernel function.
     *
     * @param   
     *      The input type for supervised learning. Will be passed to the
     *      kernel function.
     * @param   kernel
     *      The kernel function to use.
     * @param   data
     *      The supervised training data.
     * @return
     *      A new object trained on the given data.
     */
    public  DefaultKernelBinaryCategorizer learn(
        final Kernel kernel,
        final Iterable> data);

    /**
     * Creates a new kernel-based learner using the standard learning interfaces
     * based on this learner and its parameters.
     *
     * @param   
     *      The input type for supervised learning. Will be passed to the
     *      kernel function.
     * @param   kernel
     *      The kernel function to use.
     * @return
     *      A kernel-based version of this learning algorithm.
     */
    public  SupervisedBatchAndIncrementalLearner> createKernelLearner(
        final Kernel kernel);
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy