public class ALMA2K extends BaseUpdateableClassifier implements BinaryScoreClassifier, Parameterized
ALMA2
algorithm. It is important
to note that the number of "support vectors" ALMA may learn is unbounded.
setAveraged(boolean)
.
This information is always collected, and the output can be changed once
already learned.
Modifier | Constructor and Description |
---|---|
protected |
ALMA2K(ALMA2K other)
Copy constructor
|
|
ALMA2K(KernelTrick kernel,
double alpha)
Creates a new kernelized ALMA2 object
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
ALMA2K |
clone() |
double |
getAlpha()
Returns the approximation coefficient used
|
double |
getB()
Returns the B value of the ALMA algorithm
|
double |
getC() |
KernelTrick |
getKernelTrick()
Returns the kernel in use
|
Parameter |
getParameter(String paramName)
Returns the parameter with the given name.
|
List<Parameter> |
getParameters()
Returns the list of parameters that can be altered for this learner.
|
double |
getScore(DataPoint dp)
Returns the numeric score for predicting a class of a given data point,
where the sign of the value indicates which class the data point is
predicted to belong to.
|
static Distribution |
guessAlpha(DataSet d)
Guesses the distribution to use for the α parameter
|
boolean |
isAveraged()
Returns whether or not the averaged or last hypothesis is used
|
void |
setAlpha(double alpha)
Alpha controls the approximation of the large margin formed by ALMA,
with larger values causing more updates.
|
void |
setAveraged(boolean averaged)
ALMA2K supports taking the averaged output of all previous hypothesis
weighted by the number of successful uses of the hypothesis during
training.
|
void |
setB(double B)
Sets the B variable of the ALMA algorithm, this is set automatically by
setAlpha(double) . |
void |
setC(double C)
Sets the C value of the ALMA algorithm.
|
void |
setKernelTrick(KernelTrick K)
Sets the kernel to use
|
void |
setUp(CategoricalData[] categoricalAttributes,
int numericAttributes,
CategoricalData predicting)
Prepares the classifier to begin learning from its
UpdateableClassifier.update(jsat.classifiers.DataPoint, int) method. |
boolean |
supportsWeightedData()
Indicates whether the model knows how to train using weighted data points.
|
void |
update(DataPoint dataPoint,
int targetClass)
Updates the classifier by giving it a new data point to learn from.
|
getEpochs, setEpochs, trainC, trainC, trainEpochs
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
trainC, trainC
public ALMA2K(KernelTrick kernel, double alpha)
kernel
- the kernel function to usealpha
- the alpha parameter of ALMAprotected ALMA2K(ALMA2K other)
other
- the ALMA2K object to copypublic ALMA2K clone()
clone
in interface BinaryScoreClassifier
clone
in interface Classifier
clone
in interface UpdateableClassifier
clone
in class BaseUpdateableClassifier
public void setAveraged(boolean averaged)
averaged
- true
to use the averaged out, false
to
only use the last hypothesispublic boolean isAveraged()
public void setKernelTrick(KernelTrick K)
K
- the kernel to usepublic KernelTrick getKernelTrick()
public void setAlpha(double alpha)
B
will
also be set to an appropriate value. This is not the only possible value
that will lead to convergence, and can be set manually after alpha is set
to another value.alpha
- the approximation scale in (0.0, 1.0]public double getAlpha()
public void setB(double B)
setAlpha(double)
.B
- the value for Bpublic double getB()
public void setC(double C)
C
- the C value of ALMApublic double getC()
public void setUp(CategoricalData[] categoricalAttributes, int numericAttributes, CategoricalData predicting)
UpdateableClassifier
UpdateableClassifier.update(jsat.classifiers.DataPoint, int)
method.setUp
in interface UpdateableClassifier
categoricalAttributes
- an array containing the categorical
attributes that will be in each data pointnumericAttributes
- the number of numeric attributes that will be in
each data pointpredicting
- the information for the target class that will be
predictedpublic void update(DataPoint dataPoint, int targetClass)
UpdateableClassifier
update
in interface UpdateableClassifier
dataPoint
- the data point to learntargetClass
- the target class of the data pointpublic CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic double getScore(DataPoint dp)
BinaryScoreClassifier
getScore
in interface BinaryScoreClassifier
dp
- the data point to predict the class label ofpublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public static Distribution guessAlpha(DataSet d)
d
- the dataset to get the guess forsetAlpha(double)
public List<Parameter> getParameters()
Parameterized
getParameters
in interface Parameterized
public Parameter getParameter(String paramName)
Parameterized
getParameter
in interface Parameterized
paramName
- the name of the parameter to obtainCopyright © 2017. All rights reserved.