torchml.discriminant_analysis¶
Classes¶
torchml.discriminant_analysis.LinearDiscriminantAnalysis
¶
Description¶
Linear Discriminant Analysis is a classifier with a linear decision boundary, which is calculated by fitting class conditional densities to the data and using Bayes' rule. This model fits a Gaussian density to each class and it assumes that all classes share the same covariance matrix. This current implementation only includes "svd" solver.
References¶
- Linear discriminant analysis : a detailed tutorial tutorial
- The scikit-learn documentation page
Arguments¶
n_components
(int, default=None) - Number of components (features) for dimensionality reduction. If None, will be set to min(n_classes - 1, n_features).priors
(torch.Tensor, default=None) - The class prior probabilities. By default, the class proportions are calculated from the input training data.tol
(float, default=1e-4) - Absolute threshold for a singular value of X to be considered significant, used to estimate the rank of X. Used only in "svd" solver.solver
(str, default="svd") - Solver to use. Currently only support "svd" solver.
Example¶
lda = LinearDiscriminantAnalysis()
torchml.discriminant_analysis.QuadraticDiscriminantAnalysis
¶
Description¶
Quadratic Discriminant Analysis is a classifier with a quadratic decision boundary, which is calculated by fitting class conditional densities to the data and using Bayes' rule. This model fits a Gaussian density to each class. This current implementation only includes "svd" solver.
References¶
- Carl J Huberty's Discriminant Analysis paper
- The scikit-learn documentation page
Arguments¶
priors
(torch.Tensor, default=None) - The class prior probabilities. By default, the class proportions are calculated from the input training data.reg_param
(float, default=0.0) - Regularizes the per-class covariance estimates by transforming S2 asS2 = ((1 - reg_param) * S2) + reg_param
, where S2 corresponds to the scaling_ attribute of a given class.store_covariance
(bool, default=False) - If True, the class covariance matrices will be explicitly computed and stored in the self.covariance_ attribute.tol
(float, default=1e-4) - Absolute threshold for a singular value to be considered significant. This parameter does not affect the predictions. It controls a warning that is raised when features are considered to be colinear.
Example¶
qda = QuadraticDiscriminantAnalysis()