|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJavaML.ONSBoost
public class ONSBoost
An implementation of ONSBoost. (http://dx.doi.org/10.1007/978-3-642-12127-2_21) When using offline datasets, behaves like FloatBoost. Executing the train() function resets the classifier before training.
Field Summary |
---|
Fields inherited from interface JavaML.IClassifier |
---|
negativeClass, positiveClass |
Constructor Summary | |
---|---|
ONSBoost()
Constructor, needs to be supplied with a weak learner before training |
|
ONSBoost(int numLearners,
IOnlineClassifier rootLearner,
int learnerIterations,
java.lang.String learnerArgs)
Constructor, initialises everything required |
|
ONSBoost(int numLearners,
IOnlineClassifier rootLearner,
java.lang.String learnerArgs)
Constructor, initialises everything required |
Method Summary | |
---|---|
int[] |
classifyDataset(IDataset testingData)
Returns the classifications made by the trained classifier on the testing data |
int |
classifySample(double[] sample)
Returns the classification for a single example |
IOnlineClassifier |
copyClassifier()
Copy constructor |
int[] |
getFeatureList()
Returns the list of features used by each weak learner (useful for decision stumps) |
boolean |
getIsTrained()
|
int |
onlineTrain(double[] trainingData,
int target)
Is the online train function, which takes a single example and trains on it then returns the classification. |
void |
setupClassifier(java.lang.String arguments)
setupClassifier is used to modify classifiers after they have been constructed through the copy constructor, at that point you could either do reflection to figure out the class and reconstruct it, or you could pass it a string of arguments and have it reconfigure itself. |
boolean |
supportsMultiClassData()
|
boolean |
supportsWeightedData()
|
double |
test(IDataset testingData)
Is the main offline test function, which takes an dataset and returns the testing error on that dataset |
double |
train(IDataset trainingData,
int iterations)
Is the main offline train function, which takes an dataset and trains on it using the FloatBoost algorithm |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ONSBoost()
public ONSBoost(int numLearners, IOnlineClassifier rootLearner, java.lang.String learnerArgs)
numLearners
- Is the number of weak learners to userootLearner
- Is an IOnlineClassifier which all the weak learners are constructed fromlearnerArgs
- Are any arguments that weak learner needs to be constructed withpublic ONSBoost(int numLearners, IOnlineClassifier rootLearner, int learnerIterations, java.lang.String learnerArgs)
numLearners
- Is the number of weak learners to userootLearner
- Is an IOnlineClassifier which all the weak learners are constructed fromlearnerArgs
- Are any arguments that weak learner needs to be constructed withlearnerIterations
- If the weak learner needs the iterations parameter (e.g. for boosting a neural net)Method Detail |
---|
public IOnlineClassifier copyClassifier()
copyClassifier
in interface IClassifier
copyClassifier
in interface IOnlineClassifier
public void setupClassifier(java.lang.String arguments)
setupClassifier
in interface IClassifier
arguments
- a space separated list of parameter=value tuples.public double train(IDataset trainingData, int iterations)
train
in interface IClassifier
trainingData
- A training datasetiterations
- overrides the inbuilt number of weak leaners, and creates iterations
weak learnerspublic int onlineTrain(double[] trainingData, int target)
onlineTrain
in interface IOnlineClassifier
trainingData
- A training sampletarget
- class label for the samplepublic double test(IDataset testingData)
test
in interface IClassifier
testingData
- A testing datasetpublic int[] classifyDataset(IDataset testingData)
classifyDataset
in interface IClassifier
testingData
- A testing datasetpublic int classifySample(double[] sample)
classifySample
in interface IClassifier
sample
- A testing samplepublic int[] getFeatureList()
getFeatureList
in interface IClassifier
public boolean getIsTrained()
getIsTrained
in interface IClassifier
public boolean supportsWeightedData()
supportsWeightedData
in interface IClassifier
public boolean supportsMultiClassData()
supportsMultiClassData
in interface IClassifier
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |