KernelDiscriminantAnalysis Class |
Namespace: Accord.Statistics.Analysis
[SerializableAttribute] public class KernelDiscriminantAnalysis : BaseDiscriminantAnalysis, ISupervisedLearning<KernelDiscriminantAnalysisPipeline, double[], int>
The KernelDiscriminantAnalysis type exposes the following members.
Name | Description | |
---|---|---|
KernelDiscriminantAnalysis |
Constructs a new Kernel Discriminant Analysis object.
| |
KernelDiscriminantAnalysis(IKernel) |
Constructs a new Kernel Discriminant Analysis object.
| |
KernelDiscriminantAnalysis(Double, Int32, IKernel) | Obsolete.
Constructs a new Kernel Discriminant Analysis object.
| |
KernelDiscriminantAnalysis(Double, Int32, IKernel) | Obsolete.
Constructs a new Kernel Discriminant Analysis object.
|
Name | Description | |
---|---|---|
ClassCount |
Gets the observation count for each class.
(Inherited from BaseDiscriminantAnalysis.) | |
Classes |
Gets information about the distinct classes in the analyzed data.
(Inherited from BaseDiscriminantAnalysis.) | |
Classifications | Obsolete.
Gets the original classifications (labels) of the source data
given on the moment of creation of this analysis object.
(Inherited from BaseDiscriminantAnalysis.) | |
Classifier |
Gets a classification pipeline that can be used to classify
new samples into one of the NumberOfClasses
learned in this discriminant analysis. This pipeline is
only available after a call to the Learn(Double, Int32, Double) method.
| |
ClassMeans |
Gets the Mean vector for each class.
(Inherited from BaseDiscriminantAnalysis.) | |
ClassScatter |
Gets the Scatter matrix for each class.
(Inherited from BaseDiscriminantAnalysis.) | |
ClassStandardDeviations |
Gets the Standard Deviation vector for each class.
(Inherited from BaseDiscriminantAnalysis.) | |
CumulativeProportions |
The cumulative distribution of the discriminants factors proportions.
Also known as the cumulative energy of the first dimensions of the discriminant
space or as the amount of variance explained by those dimensions.
(Inherited from BaseDiscriminantAnalysis.) | |
DiscriminantMatrix | Obsolete.
Gets the Eigenvectors obtained during the analysis,
composing a basis for the discriminant factor space.
(Inherited from BaseDiscriminantAnalysis.) | |
DiscriminantProportions |
Gets the level of importance each discriminant factor has in
discriminant space. Also known as amount of variance explained.
(Inherited from BaseDiscriminantAnalysis.) | |
Discriminants |
Gets the discriminant factors in a object-oriented fashion.
(Inherited from BaseDiscriminantAnalysis.) | |
DiscriminantVectors |
Gets the Eigenvectors obtained during the analysis,
composing a basis for the discriminant factor space.
(Inherited from BaseDiscriminantAnalysis.) | |
Eigenvalues |
Gets the Eigenvalues found by the analysis associated
with each vector of the ComponentMatrix matrix.
(Inherited from BaseDiscriminantAnalysis.) | |
Input |
Gets or sets the matrix of original values used to create
this analysis. Those values are required to build kernel
(Gram) matrices when classifying new samples.
| |
Kernel |
Gets or sets the Kernel used in the analysis.
| |
Means |
Gets the mean of the original data given at method construction.
(Inherited from BaseDiscriminantAnalysis.) | |
NumberOfClasses |
Gets the number of classes in the analysis.
(Inherited from BaseDiscriminantAnalysis.) | |
NumberOfInputs |
Gets the number of inputs accepted by the model.
(Inherited from TransformBaseTInput, TOutput.) | |
NumberOfOutputs |
Gets the number of outputs generated by the model.
(Inherited from TransformBaseTInput, TOutput.) | |
NumberOfSamples |
Gets the number of samples used to create the analysis.
(Inherited from BaseDiscriminantAnalysis.) | |
ProjectionMeans |
Gets the feature space mean of the projected data.
(Inherited from BaseDiscriminantAnalysis.) | |
Regularization |
Gets or sets the regularization parameter to
avoid non-singularities at the solution.
| |
Result | Obsolete.
Gets the resulting projection of the source data given on
the creation of the analysis into discriminant space.
(Inherited from BaseDiscriminantAnalysis.) | |
ScatterBetweenClass |
Gets the Between-Class Scatter Matrix for the data.
(Inherited from BaseDiscriminantAnalysis.) | |
ScatterMatrix |
Gets the Total Scatter Matrix for the data.
(Inherited from BaseDiscriminantAnalysis.) | |
ScatterWithinClass |
Gets the Within-Class Scatter Matrix for the data.
(Inherited from BaseDiscriminantAnalysis.) | |
Source | Obsolete.
Returns the original supplied data to be analyzed.
(Inherited from BaseDiscriminantAnalysis.) | |
StandardDeviations |
Gets the standard mean of the original data given at method construction.
(Inherited from BaseDiscriminantAnalysis.) | |
Threshold |
Gets or sets the minimum variance proportion needed to keep a
discriminant component. If set to zero, all components will be
kept. Default is 0.001 (all components which contribute less
than 0.001 to the variance in the data will be discarded).
(Inherited from BaseDiscriminantAnalysis.) | |
Token |
Gets or sets a cancellation token that can be used to
stop the learning algorithm while it is running.
(Inherited from BaseDiscriminantAnalysis.) |
Name | Description | |
---|---|---|
Classify(Double) | Obsolete.
Classifies a new instance into one of the available classes.
(Overrides BaseDiscriminantAnalysisClassify(Double).) | |
Classify(Double) | Obsolete.
Classifies new instances into one of the available classes.
(Overrides BaseDiscriminantAnalysisClassify(Double).) | |
Classify(Double, Double) | Obsolete.
Classifies a new instance into one of the available classes.
(Overrides BaseDiscriminantAnalysisClassify(Double, Double).) | |
Compute | Obsolete.
Computes the Multi-Class Kernel Discriminant Analysis algorithm.
| |
CreateDiscriminants |
Creates additional information about principal components.
(Inherited from BaseDiscriminantAnalysis.) | |
DiscriminantFunction |
Gets the output of the discriminant function for a given class.
(Overrides BaseDiscriminantAnalysisDiscriminantFunction(Double, Int32).) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetNumberOfDimensions |
Returns the minimum number of discriminant space dimensions (discriminant
factors) required to represent a given percentile of the data.
(Inherited from BaseDiscriminantAnalysis.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
init | Obsolete.
Obsolete.
(Inherited from BaseDiscriminantAnalysis.) | |
Init |
Initializes common properties.
(Inherited from BaseDiscriminantAnalysis.) | |
Learn |
Learns a model that can map the given inputs to the given outputs.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Transform(Double) | Obsolete.
Obsolete.
(Inherited from BaseDiscriminantAnalysis.) | |
Transform(Double) |
Applies the transformation to an input, producing an associated output.
(Inherited from BaseDiscriminantAnalysis.) | |
Transform(Double) |
Applies the transformation to an input, producing an associated output.
(Inherited from BaseDiscriminantAnalysis.) | |
Transform(Double, Int32) | Obsolete.
Obsolete.
(Inherited from BaseDiscriminantAnalysis.) | |
Transform(Double, Int32) | Obsolete.
Obsolete.
(Inherited from BaseDiscriminantAnalysis.) | |
Transform(Double, Int32) | Obsolete.
Obsolete.
(Inherited from BaseDiscriminantAnalysis.) | |
Transform(Double, Double) |
Applies the transformation to an input, producing an associated output.
(Overrides TransformBaseTInput, TOutputTransform(TInput, TOutput).) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
Kernel (Fisher) discriminant analysis (kernel FDA) is a non-linear generalization of linear discriminant analysis (LDA) using techniques of kernel methods. Using a kernel, the originally linear operations of LDA are done in a reproducing kernel Hilbert space with a non-linear mapping.
The algorithm used is a multi-class generalization of the original algorithm by Mika et al. in Fisher discriminant analysis with kernels (1999).
This class can also be bound to standard controls such as the DataGridView by setting their DataSource property to the analysis' Discriminants property.
References:
// Create some sample input data instances. This is the same // data used in the Gutierrez-Osuna's example available on: // http://research.cs.tamu.edu/prism/lectures/pr/pr_l10.pdf double[][] inputs = { // Class 0 new double[] { 4, 1 }, new double[] { 2, 4 }, new double[] { 2, 3 }, new double[] { 3, 6 }, new double[] { 4, 4 }, // Class 1 new double[] { 9, 10 }, new double[] { 6, 8 }, new double[] { 9, 5 }, new double[] { 8, 7 }, new double[] { 10, 8 } }; int[] output = { 0, 0, 0, 0, 0, // The first five are from class 0 1, 1, 1, 1, 1 // The last five are from class 1 }; // We'll create a KDA using a Linear kernel var kda = new KernelDiscriminantAnalysis() { Kernel = new Linear() // We can choose any kernel function }; // Compute the analysis and create a classifier var classifier = kda.Learn(inputs, output); // Now we can project the data into KDA space: double[][] projection = kda.Transform(inputs); // Or perform classification using: int[] results = kda.Classify(inputs);