com.gregdennis.drej
Class Representer

java.lang.Object
  extended by com.gregdennis.drej.Representer
All Implemented Interfaces:
Function

public final class Representer
extends java.lang.Object
implements Function

A representer function with a kernel K(x1, x2), a set of training data points (d1, d2, …, dn), and a vector (c1, c2, …, cn) of coefficients.

ƒ(x) = ∑ ciK(di, x)

Author:
Greg Dennis (gdennis@mit.edu)

Constructor Summary
Representer(Kernel kernel, GMatrix data, GVector coeffs)
          Constructs a new representer with the specified kernel, data matrix, and coefficients.
 
Method Summary
 GVector coeffs()
          Returns a copy of the vector of coefficients.
 double eval(GVector x)
          Evaluates the function at the specified point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Representer

public Representer(Kernel kernel,
                   GMatrix data,
                   GVector coeffs)
Constructs a new representer with the specified kernel, data matrix, and coefficients. The data matrix is expected to contain one data point in each column.

Throws:
MismatchedSizeException - if number of data columns differs from number of coefficients.
Method Detail

coeffs

public GVector coeffs()
Returns a copy of the vector of coefficients.


eval

public double eval(GVector x)
Description copied from interface: Function
Evaluates the function at the specified point.

Specified by:
eval in interface Function