public class RDA extends Object implements Classifier<double[]>
| Modifier and Type | Class and Description |
|---|---|
static class |
RDA.Trainer
Trainer for regularized discriminant analysis.
|
| Constructor and Description |
|---|
RDA(double[][] x,
int[] y,
double alpha)
Constructor.
|
RDA(double[][] x,
int[] y,
double[] priori,
double alpha)
Constructor.
|
RDA(double[][] x,
int[] y,
double[] priori,
double alpha,
double tol)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
getPriori()
Returns a priori probabilities.
|
int |
predict(double[] x)
Predicts the class label of an instance.
|
int |
predict(double[] x,
double[] posteriori)
Predicts the class label of an instance and also calculate a posteriori
probabilities.
|
public RDA(double[][] x, int[] y, double alpha)
x - training samples.y - training labels in [0, k), where k is the number of classes.alpha - regularization factor in [0, 1] allows a continuum of models
between LDA and QDA.public RDA(double[][] x, int[] y, double[] priori, double alpha)
x - training samples.y - training labels in [0, k), where k is the number of classes.alpha - regularization factor in [0, 1] allows a continuum of models
between LDA and QDA.priori - the priori probability of each class.public RDA(double[][] x, int[] y, double[] priori, double alpha, double tol)
x - training samples.y - training labels in [0, k), where k is the number of classes.alpha - regularization factor in [0, 1] allows a continuum of models
between LDA and QDA.priori - the priori probability of each class.tol - tolerance to decide if a covariance matrix is singular; it
will reject variables whose variance is less than tol2.public double[] getPriori()
public int predict(double[] x)
Classifierpredict in interface Classifier<double[]>x - the instance to be classified.public int predict(double[] x,
double[] posteriori)
Classifierpredict in interface Classifier<double[]>x - the instance to be classified.posteriori - the array to store a posteriori probabilities on output.Copyright © 2015. All rights reserved.