Home | Trees | Indices | Help |
|
---|
|
Perform a (generalized) Fisher Discriminant Analysis of its input. It is a supervised node that implements FDA using a generalized eigenvalue approach. FDANode has two training phases and is supervised so make sure to pay attention to the following points when you train it: - call the 'train' function with *two* arguments: the input data and the labels (see the doc string of the train method for details) - if you are training the node by hand, call the train function twice - if you are training the node using a flow (recommended), the only argument to Flow.train must be a list of (data_point, label) tuples or an iterator returning lists of such tuples, *not* a generator. The Flow.train function can be called just once as usual, since it takes care of "rewinding" the iterator to perform the second training step. More information on Fisher Discriminant Analysis can be found for example in C. Bishop, Neural Networks for Pattern Recognition, Oxford Press, pp. 105-112. Internal variables of interest: self.avg -- Mean of the input data (available after training) self.v -- Transposed of the projection matrix, so that output = dot(input-self.avg, self.v) (available after training)
|
|||
Inherited from Node | |||
---|---|---|---|
__metaclass__ This Metaclass is meant to overwrite doc strings of methods like execute, stop_training, inverse with the ones defined in the corresponding private methods _execute, _stop_training, _inverse, etc... |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|||
Inherited from Node | |||
---|---|---|---|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
Inherited from |
|||
Inherited from Node | |||
---|---|---|---|
_train_seq List of tuples: [(training-phase1, stop-training-phase1), (training-phase2, stop_training-phase2), ... |
|||
dtype dtype |
|||
input_dim Input dimensions |
|||
output_dim Output dimensions |
|||
supported_dtypes Supported dtypes |
|
If the input dimension and the output dimension are unspecified, they will be set when the 'train' or 'execute' method is called for the first time. If dtype is unspecified, it will be inherited from the data it receives at the first call of 'train' or 'execute'. Every subclass must take care of up- or down-casting the internal structures to match this argument (use _refcast private method when possible).
|
|
Compute the output of the FDA projection. if 'range' is a number, then use the first 'range' functions. if 'range' is the interval=(i,j), then use all functions between i and j.
|
Return the list of dtypes supported by this node.
|
|
|
Solve the eigenvalue problem for the total covariance. |
Calculate the class means. |
Update the internal structures according to the input data 'x'. x -- a matrix having different variables on different columns and observations on the rows. cl -- can be a list, tuple or array of labels (one for each data point) or a single label, in which case all input data is assigned to the same class.
|
Gather data for the overall and within-class covariance |
Gather data to compute the means and number of elements. |
Update the covariance matrix of the class means. x -- Data points from a single class. lbl -- The label for that class. |
Update the internal variables that store the data for the means. x -- Data points from a single class. lbl -- The label for that class. |
Compute the output of the FDA projection. if 'range' is a number, then use the first 'range' functions. if 'range' is the interval=(i,j), then use all functions between i and j.
|
Update the internal structures according to the input data 'x'. x -- a matrix having different variables on different columns and observations on the rows. cl -- can be a list, tuple or array of labels (one for each data point) or a single label, in which case all input data is assigned to the same class.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Oct 9 06:08:51 2009 | http://epydoc.sourceforge.net |