tpp
Class LinearProjection

java.lang.Object
  extended by weka.core.matrix.Matrix
      extended by tpp.LinearProjection
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Projection, RevisionHandler

public class LinearProjection
extends Matrix
implements Projection

A linear projection. the projection is defined by a matrix and projection pursuit is achieved by application of the perceptron learning rule. In other words we treat the projection as a bunch of linear neurons.

See Also:
Serialized Form

Constructor Summary
LinearProjection(int inputDimensions, int outputDimensions)
           
LinearProjection(Matrix m)
          Construct a LinearProjection from a matrix
 
Method Summary
 void normalise()
          Scale the projection so that all values are in the range [-1,1].
 void PCA(Matrix data)
          Find the principle components of the given data.
 Matrix project(Matrix data)
          Apply the projection to the given data.
 double pursueTarget(Matrix data, Matrix target)
          Find the projection that best maps the data to the target.
 double pursueTarget(Matrix data, Matrix target, boolean[] inTrainingSet)
          Try to find a projection that best maps the data to the target.
 double pursueTargetSingleShot(Matrix data, Matrix target, boolean[] inTrainingSet)
           
 void randomize()
          Set all projection values to a random values in [-1,1]
 LinearProjection removeAttribute(int i)
          Create a new projection by removing a single attribute (row)
 void train(Matrix data, Matrix target, boolean[] selected, double[][] previousWeights, double rate)
           
 
Methods inherited from class weka.core.matrix.Matrix
arrayLeftDivide, arrayLeftDivideEquals, arrayRightDivide, arrayRightDivideEquals, arrayTimes, arrayTimesEquals, chol, clone, cond, constructWithCopy, copy, det, eig, get, getArray, getArrayCopy, getColumnDimension, getColumnPackedCopy, getMatrix, getMatrix, getMatrix, getMatrix, getRevision, getRowDimension, getRowPackedCopy, identity, inverse, isSquare, isSymmetric, lu, main, minus, minusEquals, norm1, norm2, normF, normInf, parseMatlab, plus, plusEquals, print, print, print, print, qr, random, rank, read, regression, regression, set, setMatrix, setMatrix, setMatrix, setMatrix, solve, solveTranspose, sqrt, svd, times, times, timesEquals, toMatlab, toString, trace, transpose, uminus, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearProjection

public LinearProjection(int inputDimensions,
                        int outputDimensions)

LinearProjection

public LinearProjection(Matrix m)
Construct a LinearProjection from a matrix

Method Detail

project

public Matrix project(Matrix data)
Description copied from interface: Projection
Apply the projection to the given data.

Specified by:
project in interface Projection

pursueTarget

public double pursueTarget(Matrix data,
                           Matrix target)
Description copied from interface: Projection
Find the projection that best maps the data to the target. Return the error.

Specified by:
pursueTarget in interface Projection

pursueTargetSingleShot

public double pursueTargetSingleShot(Matrix data,
                                     Matrix target,
                                     boolean[] inTrainingSet)

pursueTarget

public double pursueTarget(Matrix data,
                           Matrix target,
                           boolean[] inTrainingSet)
Try to find a projection that best maps the data to the target.

Parameters:
data -
target -
inTrainingSet - which points have been selected -- we ignore the other ones. (if ==null then we use all the points)
Returns:
the resulting error (norm_frobenius(error) / norm_frobenius(target))

train

public void train(Matrix data,
                  Matrix target,
                  boolean[] selected,
                  double[][] previousWeights,
                  double rate)

randomize

public void randomize()
Set all projection values to a random values in [-1,1]


normalise

public void normalise()
Scale the projection so that all values are in the range [-1,1].


PCA

public void PCA(Matrix data)
Find the principle components of the given data.


removeAttribute

public LinearProjection removeAttribute(int i)
Create a new projection by removing a single attribute (row)