Home | Trees | Indices | Help |
|
---|
|
Quadratic Discriminant Analysis This node has been automatically generated by wrapping the ``sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis`` class from the ``sklearn`` library. The wrapped instance can be accessed through the ``scikits_alg`` attribute. A classifier with a quadratic decision boundary, generated by fitting class conditional densities to the data and using Bayes' rule. The model fits a Gaussian density to each class. .. versionadded:: 0.17 *QuadraticDiscriminantAnalysis* .. versionchanged:: 0.17 Deprecated :class:`qda.QDA` have been moved to *QuadraticDiscriminantAnalysis*. **Parameters** priors : array, optional, shape = [n_classes] Priors on classes reg_param : float, optional Regularizes the covariance estimate as ``(1-reg_param)*Sigma + reg_param*np.eye(n_features)`` **Attributes** ``covariances_`` : list of array-like, shape = [n_features, n_features] Covariance matrices of each class. ``means_`` : array-like, shape = [n_classes, n_features] Class means. ``priors_`` : array-like, shape = [n_classes] Class priors (sum to 1). ``rotations_`` : list of arrays For each class k an array of shape [n_features, n_k], with ``n_k = min(n_features, number of elements in class k)`` It is the rotation of the Gaussian distribution, i.e. its principal axis. ``scalings_`` : list of arrays For each class k an array of shape [n_k]. It contains the scaling of the Gaussian distributions along its principal axes, i.e. the variance in the rotated coordinate system. store_covariances : boolean If True the covariance matrices are computed and stored in the `self.covariances_` attribute. .. versionadded:: 0.17 tol : float, optional, default 1.0e-4 Threshold used for rank estimation. .. versionadded:: 0.17 **Examples** >>> from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis >>> import numpy as np >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) >>> y = np.array([1, 1, 1, 2, 2, 2]) >>> clf = QuadraticDiscriminantAnalysis() >>> clf.fit(X, y) ... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE QuadraticDiscriminantAnalysis(priors=None, reg_param=0.0, store_covariances=False, tol=0.0001) >>> print(clf.predict([[-0.8, -1]])) [1] See also sklearn.discriminant_analysis.LinearDiscriminantAnalysis: Linear Discriminant Analysis
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|||
Inherited from ClassifierCumulator | |||
---|---|---|---|
|
|||
|
|||
|
|||
Inherited from ClassifierNode | |||
|
|||
|
|||
|
|||
|
|||
|
|||
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 |
|
Quadratic Discriminant Analysis This node has been automatically generated by wrapping the ``sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis`` class from the ``sklearn`` library. The wrapped instance can be accessed through the ``scikits_alg`` attribute. A classifier with a quadratic decision boundary, generated by fitting class conditional densities to the data and using Bayes' rule. The model fits a Gaussian density to each class. .. versionadded:: 0.17 *QuadraticDiscriminantAnalysis* .. versionchanged:: 0.17 Deprecated :class:`qda.QDA` have been moved to *QuadraticDiscriminantAnalysis*. **Parameters** priors : array, optional, shape = [n_classes] Priors on classes reg_param : float, optional Regularizes the covariance estimate as ``(1-reg_param)*Sigma + reg_param*np.eye(n_features)`` **Attributes** ``covariances_`` : list of array-like, shape = [n_features, n_features] Covariance matrices of each class. ``means_`` : array-like, shape = [n_classes, n_features] Class means. ``priors_`` : array-like, shape = [n_classes] Class priors (sum to 1). ``rotations_`` : list of arrays For each class k an array of shape [n_features, n_k], with ``n_k = min(n_features, number of elements in class k)`` It is the rotation of the Gaussian distribution, i.e. its principal axis. ``scalings_`` : list of arrays For each class k an array of shape [n_k]. It contains the scaling of the Gaussian distributions along its principal axes, i.e. the variance in the rotated coordinate system. store_covariances : boolean If True the covariance matrices are computed and stored in the `self.covariances_` attribute. .. versionadded:: 0.17 tol : float, optional, default 1.0e-4 Threshold used for rank estimation. .. versionadded:: 0.17 **Examples** >>> from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis >>> import numpy as np >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) >>> y = np.array([1, 1, 1, 2, 2, 2]) >>> clf = QuadraticDiscriminantAnalysis() >>> clf.fit(X, y) ... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE QuadraticDiscriminantAnalysis(priors=None, reg_param=0.0, store_covariances=False, tol=0.0001) >>> print(clf.predict([[-0.8, -1]])) [1] See also sklearn.discriminant_analysis.LinearDiscriminantAnalysis: Linear Discriminant Analysis
|
|
|
Transform the data and labels lists to array objects and reshape them.
|
|
|
Perform classification on an array of test vectors X. This node has been automatically generated by wrapping the sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis class from the sklearn library. The wrapped instance can be accessed through the scikits_alg attribute. The predicted class C for each sample in X is returned. Parameters X : array-like, shape = [n_samples, n_features] Returns C : array, shape = [n_samples]
|
Fit the model according to the given training data and parameters. This node has been automatically generated by wrapping the ``sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis`` class from the ``sklearn`` library. The wrapped instance can be accessed through the ``scikits_alg`` attribute. .. versionchanged:: 0.17 Deprecated *store_covariance* have been moved to main constructor. .. versionchanged:: 0.17 Deprecated *tol* have been moved to main constructor. **Parameters** X : array-like, shape = [n_samples, n_features] Training vector, where n_samples in the number of samples and n_features is the number of features. y : array, shape = [n_samples] Target values (integers)
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Mar 8 12:39:48 2016 | http://epydoc.sourceforge.net |