gov.sandia.cognition.learning.function.scalar
Class PolynomialFunction.Regression

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.scalar.PolynomialFunction.Regression
All Implemented Interfaces:
BatchLearner<Collection<? extends InputOutputPair<? extends Double,Double>>,VectorFunctionLinearDiscriminant<Double>>, SupervisedBatchLearner<Double,Double,VectorFunctionLinearDiscriminant<Double>>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
PolynomialFunction

public static class PolynomialFunction.Regression
extends AbstractCloneableSerializable
implements SupervisedBatchLearner<Double,Double,VectorFunctionLinearDiscriminant<Double>>

Performs Linear Regression using an arbitrary set of PolynomialFunction basis functions

See Also:
Serialized Form

Constructor Summary
PolynomialFunction.Regression(double... polynomialExponents)
          Creates a new instance of Regression
 
Method Summary
 ScalarBasisSet<Double> getPolynomials()
          Getter for polynomials
 VectorFunctionLinearDiscriminant<Double> 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.
static VectorFunctionLinearDiscriminant<Double> learn(int maxOrder, Collection<? extends InputOutputPair<Double,Double>> data)
          Performs LinearRegression using all integer-exponent polynomials less than or equal to the maxOrder
 void setPolynomials(ScalarBasisSet<Double> polynomials)
          Setter for polynomials
 
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

PolynomialFunction.Regression

public PolynomialFunction.Regression(double... polynomialExponents)
Creates a new instance of Regression

Parameters:
polynomialExponents - Set of polynomial exponents to use during the regression
Method Detail

learn

public static VectorFunctionLinearDiscriminant<Double> learn(int maxOrder,
                                                             Collection<? extends InputOutputPair<Double,Double>> data)
Performs LinearRegression using all integer-exponent polynomials less than or equal to the maxOrder

Parameters:
maxOrder - Uses all polynomials below the maxOrder: a0*x^0 + a1*x^1 + ... am*a^m
data - Data set to use for the LinearRegression
Returns:
LinearCombinationFunction that combines the desired PolynomialFunctions with weighting coefficients determined by the LinearRegression algorithm

learn

public VectorFunctionLinearDiscriminant<Double> 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>>,VectorFunctionLinearDiscriminant<Double>>
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.

getPolynomials

public ScalarBasisSet<Double> getPolynomials()
Getter for polynomials

Returns:
Polynomials to use in the regression

setPolynomials

public void setPolynomials(ScalarBasisSet<Double> polynomials)
Setter for polynomials

Parameters:
polynomials - Polynomials to use in the regression