public class BOGD extends BaseUpdateableClassifier implements BinaryScoreClassifier, Parameterized
Constructor and Description |
---|
BOGD(BOGD toCopy)
Copy constructor
|
BOGD(KernelTrick k,
int budget,
double eta,
double reg,
double maxCoeff)
Creates a new BOGD++ learner using the
HingeLoss |
BOGD(KernelTrick k,
int budget,
double eta,
double reg,
double maxCoeff,
LossC lossC)
Creates a new BOGD++ learner
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
BOGD |
clone() |
int |
getBudget()
Returns the maximum number of allowed support vectors
|
double |
getEta()
Returns the learning rate in use
|
KernelTrick |
getKernel()
Returns the kernel to use
|
double |
getMaxCoeff()
Returns the maximum allowed value for any support vector
|
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 |
getRegularization()
Returns the regularization parameter used
|
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 |
guessEta(DataSet d)
Guesses the distribution to use for the η parameter
|
static Distribution |
guessMaxCoeff(DataSet d)
Guesses the distribution to use for the MaxCoeff parameter
|
static Distribution |
guessRegularization(DataSet d)
Guesses the distribution to use for the Regularization parameter
|
boolean |
isUniformSampling()
Returns
true is uniform sampling is in use, or false if
the BOGD++ sampling procedure is in use |
void |
setBudget(int budget)
Sets the budget for support vectors
|
void |
setEta(double eta)
Sets the learning rate to use for training.
|
void |
setKernel(KernelTrick k)
Sets the kernel to use
|
void |
setMaxCoeff(double maxCoeff)
Sets the maximum allowed value for any support vector allowed.
|
void |
setRegularization(double regularization)
Sets the regularization parameter used for training.
|
void |
setUniformSampling(boolean uniformSampling)
Sets whether or not support vectors should be removed by uniform sampling
or not.
|
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 BOGD(KernelTrick k, int budget, double eta, double reg, double maxCoeff)
HingeLoss
k
- the kernel trick to usebudget
- the budget for support vectors to alloweta
- the learning rate to usereg
- the regularization parametermaxCoeff
- the maximum support vector coefficient to allowpublic BOGD(KernelTrick k, int budget, double eta, double reg, double maxCoeff, LossC lossC)
k
- the kernel trick to usebudget
- the budget for support vectors to alloweta
- the learning rate to usereg
- the regularization parametermaxCoeff
- the maximum support vector coefficient to allowlossC
- the loss function to usepublic BOGD(BOGD toCopy)
toCopy
- the object to make a copy ofpublic void setRegularization(double regularization)
regularization
- the positive regularization parameter to use.public double getRegularization()
public void setEta(double eta)
eta
- the positive learning rate to usepublic double getEta()
public void setMaxCoeff(double maxCoeff)
maxCoeff
- the maximum value for any support vectorpublic double getMaxCoeff()
public void setBudget(int budget)
budget
- the allowed budget for support vectorspublic int getBudget()
public void setKernel(KernelTrick k)
k
- the kernel to usepublic KernelTrick getKernel()
public void setUniformSampling(boolean uniformSampling)
false
, which corresponds to BOGD++.uniformSampling
- true
to use uniform sampling,
false
otherwise.public boolean isUniformSampling()
true
is uniform sampling is in use, or false
if
the BOGD++ sampling procedure is in usetrue
is uniform sampling is in use, or false
if
the BOGD++ sampling procedure is in usepublic BOGD clone()
clone
in interface BinaryScoreClassifier
clone
in interface Classifier
clone
in interface UpdateableClassifier
clone
in class BaseUpdateableClassifier
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 double getScore(DataPoint dp)
BinaryScoreClassifier
getScore
in interface BinaryScoreClassifier
dp
- the data point to predict the class label ofpublic 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 boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public static Distribution guessRegularization(DataSet d)
d
- the dataset to get the guess forsetRegularization(double)
public static Distribution guessEta(DataSet d)
d
- the dataset to get the guess forsetEta(double)
public static Distribution guessMaxCoeff(DataSet d)
d
- the dataset to get the guess for(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.