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`` method 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`` method 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 Inherited from |
|||
Inherited from Node | |||
---|---|---|---|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
Inherited from Node | |||
---|---|---|---|
|
|||
|
|
|||
Inherited from |
|||
Inherited from Node | |||
---|---|---|---|
_train_seq List of tuples:: |
|||
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 'n' is an integer, then use the first 'n' components.
|
|
|
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. label -- 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. label -- The label for that class. |
Update the internal variables that store the data for the means. x -- Data points from a single class. label -- The label for that class. |
Compute the output of the FDA projection. If 'n' is an integer, then use the first 'n' components.
|
Invert `y`. If the node is invertible, compute the input ``x`` such that ``y = execute(x)``. By default, subclasses should overwrite `_inverse` to implement their `inverse` function. The docstring of the `inverse` method overwrites this docstring.
|
Update the internal structures according to the input data 'x'. x -- a matrix having different variables on different columns and observations on the rows. label -- 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 Thu Mar 10 15:28:13 2016 | http://epydoc.sourceforge.net |