|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjml.classification.Classifier
jml.classification.AdaBoost
public class AdaBoost
A Java implementation for AdaBoost.
Field Summary | |
---|---|
(package private) double[] |
alphas
Weights on the outputs of the trained weak classifiers. |
private static long |
serialVersionUID
|
(package private) int |
T
Number of iterations, or the number of weak classifiers. |
(package private) Classifier[] |
weakClassifiers
The sequence of weak classifiers during training. |
Fields inherited from class jml.classification.Classifier |
---|
epsilon, IDLabelMap, labelIDs, labels, nClass, nExample, nFeature, W, X, Y |
Constructor Summary | |
---|---|
AdaBoost()
Default constructor. |
|
AdaBoost(Classifier[] weakClassifiers)
Constructor. |
Method Summary | |
---|---|
void |
loadModel(java.lang.String filePath)
Load the model for a classifier. |
static void |
main(java.lang.String[] args)
|
org.apache.commons.math.linear.RealMatrix |
predictLabelMatrix(org.apache.commons.math.linear.RealMatrix Xt)
Predict the label matrix given test data formated as an original data matrix. |
org.apache.commons.math.linear.RealMatrix |
predictLabelScoreMatrix(org.apache.commons.math.linear.RealMatrix Xt)
Predict the label score matrix given test data formated as an original data matrix. |
void |
saveModel(java.lang.String filePath)
Save the model for a classifier. |
void |
train()
Train the classifier. |
Methods inherited from class jml.classification.Classifier |
---|
calcNumClass, feedData, feedData, feedLabels, feedLabels, feedLabels, getAccuracy, getIDLabelMap, getLabelIDMap, getProjectionMatrix, getTrainingLabelMatrix, labelIndexArray2LabelMatrix, labelScoreMatrix2LabelIndexArray, predict, predict, predictLabelMatrix, predictLabelScoreMatrix |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
int T
Classifier[] weakClassifiers
double[] alphas
Constructor Detail |
---|
public AdaBoost(Classifier[] weakClassifiers)
weakClassifiers
- a sequence of weak classifiers to be
trained during the boosting procedurepublic AdaBoost()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- public void loadModel(java.lang.String filePath)
Classifier
loadModel
in class Classifier
filePath
- file path to load the modelpublic void saveModel(java.lang.String filePath)
Classifier
saveModel
in class Classifier
filePath
- file path to save the modelpublic void train()
Classifier
train
in class Classifier
public org.apache.commons.math.linear.RealMatrix predictLabelMatrix(org.apache.commons.math.linear.RealMatrix Xt)
Classifier
predictLabelMatrix
in class Classifier
Xt
- test data matrix with each column being a feature vector
public org.apache.commons.math.linear.RealMatrix predictLabelScoreMatrix(org.apache.commons.math.linear.RealMatrix Xt)
Classifier
predictLabelScoreMatrix
in class Classifier
Xt
- test data matrix with each column being a feature vector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |