gov.sandia.cognition.learning.algorithm.regression
Class UnivariateLinearRegression

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.regression.UnivariateLinearRegression
All Implemented Interfaces:
BatchLearner<Collection<? extends InputOutputPair<? extends Double,Double>>,LinearFunction>, SupervisedBatchLearner<Double,Double,LinearFunction>, CloneableSerializable, Serializable, Cloneable

public class UnivariateLinearRegression
extends AbstractCloneableSerializable
implements SupervisedBatchLearner<Double,Double,LinearFunction>

An implementation of simple univariate linear regression. It fits a function of the form f(x) = mx + b to the given data. It supports learning from weighted examples.

Since:
3.3.3
Author:
Justin Basilico
See Also:
Serialized Form

Constructor Summary
UnivariateLinearRegression()
          Creates a new UnivariateLinearRegression.
 
Method Summary
 LinearFunction learn(Collection<? extends InputOutputPair<? extends Double,Double>> data)
          The learn method creates an object of ResultType using data of type DataType, using some form of "learning" algorithm.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

UnivariateLinearRegression

public UnivariateLinearRegression()
Creates a new UnivariateLinearRegression.

Method Detail

learn

public LinearFunction learn(Collection<? extends InputOutputPair<? extends Double,Double>> data)
Description copied from interface: BatchLearner
The learn method creates an object of ResultType using data of type DataType, using some form of "learning" algorithm.

Specified by:
learn in interface BatchLearner<Collection<? extends InputOutputPair<? extends Double,Double>>,LinearFunction>
Parameters:
data - The data that the learning algorithm will use to create an object of ResultType.
Returns:
The object that is created based on the given data using the learning algorithm.