public class OnlineAMM extends BaseUpdateableClassifier implements Parameterized
Modifier and Type | Field and Description |
---|---|
protected double |
c |
protected int |
classBudget |
static int |
DEFAULT_CLASS_BUDGET
The default
class budget is
50. |
static double |
DEFAULT_PRUNE_CONSTANT
The default
pruning constant is
10.0. |
static int |
DEFAULT_PRUNE_FREQUENCY
The default
frequency for pruning is
10000. |
static double |
DEFAULT_REGULARIZER
The default
regularization value is
0.01. |
protected int |
k |
protected double |
lambda |
protected int[] |
nextID |
protected int |
time |
protected List<Map<Integer,Vec>> |
weightMatrix |
Constructor and Description |
---|
OnlineAMM()
Creates a new online AMM learner
|
OnlineAMM(double lambda)
Creates a new online AMM learner
|
OnlineAMM(double lambda,
int classBudget)
Creates a new online AMM learner
|
OnlineAMM(OnlineAMM toCopy)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
OnlineAMM |
clone() |
double |
getC()
Returns the pruning constant
|
int |
getClassBudget()
Returns the maximum number of hyperplanes allowed per class
|
double |
getLambda()
Returns the regularization parameter
|
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.
|
int |
getPruneFrequency()
Returns the number of iterations between each pruning
|
static Distribution |
guessLambda(DataSet d)
Guess the distribution to use for the regularization term
λ in AMM. |
void |
setC(double c)
Sets the pruning constant which controls how powerful pruning is when
pruning occurs.
|
void |
setClassBudget(int classBudget)
When given bad parameters there is the possibility for unbounded growth
in the number of hyperplanes used.
|
void |
setLambda(double lambda)
Sets the regularization parameter for this algorithm.
|
void |
setPruneFrequency(int frequency)
Sets the frequency at which the weight vectors are pruned.
|
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 y_t)
Updates the classifier by giving it a new data point to learn from.
|
protected int |
update(DataPoint dataPoint,
int y_t,
int z_t)
Performs the work for an update.
|
getEpochs, setEpochs, trainC, trainC, trainEpochs
protected int[] nextID
protected double lambda
protected int k
protected double c
protected int time
protected int classBudget
public static final int DEFAULT_PRUNE_FREQUENCY
frequency for pruning
is
10000.public static final double DEFAULT_PRUNE_CONSTANT
pruning constant
is
10.0.public static final int DEFAULT_CLASS_BUDGET
class budget
is
50.public static final double DEFAULT_REGULARIZER
regularization value
is
0.01.public OnlineAMM()
public OnlineAMM(double lambda)
lambda
- the regularization value to usepublic OnlineAMM(double lambda, int classBudget)
lambda
- the regularization value to useclassBudget
- the maximum number of weight vectors for each classpublic OnlineAMM(OnlineAMM toCopy)
toCopy
- the object to copypublic OnlineAMM clone()
clone
in interface Classifier
clone
in interface UpdateableClassifier
clone
in class BaseUpdateableClassifier
public void setLambda(double lambda)
lambda
- the positive regularization parameter in (0, ∞)public double getLambda()
public void setPruneFrequency(int frequency)
frequency
- the number of iterations between each pruningpublic int getPruneFrequency()
public void setC(double c)
c
- the positive pruning constant to use in (0, ∞)public double getC()
public void setClassBudget(int classBudget)
classBudget
- the maximum number of hyperplanes allowed per classpublic int getClassBudget()
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 y_t)
UpdateableClassifier
update
in interface UpdateableClassifier
dataPoint
- the data point to learny_t
- the target class of the data pointprotected int update(DataPoint dataPoint, int y_t, int z_t)
dataPoint
- the data point to use in the updatey_t
- the true label of the data pointz_t
- the hyperplane of the true class with the maximum response, or Integer.MIN_VALUE
if it should be calculatedpublic CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
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 obtainpublic static Distribution guessLambda(DataSet d)
λ
in AMM.d
- the data set to get the guess forCopyright © 2017. All rights reserved.