Documentation
¶
Overview ¶
Package lda provides methods for calculating linear discriminant analysis (LDA). LDA can be used as a dimensionality reduction technique and as a classifier. Both capabilities are often used in the realm of machine learning and statistical modeling. This package provides a prediction method that can classify input data based on previous calculations and feature extraction from training data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LD ¶
type LD struct {
// contains filtered or unexported fields
}
LD is a type for computing and extracting the linear discriminant analysis of a matrix. The results of the linear discriminant analysis are only valid if the call to LinearDiscriminant was successful.
func (*LD) GetEigen ¶
GetEigen is a getter method for eigen values
No parameters. Returns a mat.Eigen object
func (*LD) LinearDiscriminant ¶
LinearDiscriminant performs linear discriminant analysis on the matrix of the input data, which is represented as an n×p matrix x, where each row is an observation and each column is a variable.
Parameter x is a matrix of input/training data. Parameter y is an array of input/training labels in [0,k) where k is the number of classes. Returns true iff the analysis was successful.
func (*LD) Predict ¶
Predict performs a prediction based on training data to assess which class a certain set of data would be in.
Parameter x is the set of data to classify. Returns a prediction for what class the set of data would be in.
Additional details: LDA can be used as a supervised learning algorithm to predict and classify data based on features extracted from training data. LDA reduces dimensionality of the data and performs feature extraction to maximize separation between classes. Precondition: training data must be labeled and labels must be ints starting from 0.