public class S3VMLightPegasos extends java.lang.Object implements TransductiveClassifier<double[]>
Constructor and Description |
---|
S3VMLightPegasos()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
double |
getB()
Tells the bias b of (w*x -b)
|
int |
getK()
Tells the number of samples used for sub-gradient calculation by internal Pegasos solver
|
double |
getLambda()
Tells the learning rate lambda of internal Pegasos solver
|
int |
getNumplus()
Tells the number of positive samples (used for transductive label estimation)
|
int |
getT()
Tells the number of iteration for internal Pegasos algorithm
|
double |
getT0()
Tells the iterations offset of internal Pegasos solver
|
double[] |
getW()
Tells the hyperplane array of this classifier
|
boolean |
isBias()
Tells if this classifier uses a bias term
|
void |
setBias(boolean bias)
Sets the use of a bias term in this classifier
|
void |
setK(int k)
Sets the number of samples used for sub-gradient calculation by internal Pegasos solver
|
void |
setLambda(double lambda)
Sets the learning rate lambda of internal Pegasos solver
|
void |
setNumplus(int numplus)
Sets the number of positives samples (used for transductive label estimation)
|
void |
setT(int t)
Sets the number of iteration for internal Pegasos algorithm
|
void |
setT0(double t0)
Sets the iterations offset of internal Pegasos solver
|
void |
train(java.util.List<TrainingSample<double[]>> trainList,
java.util.List<TrainingSample<double[]>> testList)
Train the classifier on trainList, with the help of testList in a transductive way.
|
double |
valueOf(double[] t)
prediction output for t.
|
public void train(java.util.List<TrainingSample<double[]>> trainList, java.util.List<TrainingSample<double[]>> testList)
TransductiveClassifier
train
in interface TransductiveClassifier<double[]>
public double valueOf(double[] t)
TransductiveClassifier
valueOf
in interface TransductiveClassifier<double[]>
t
- sample to evaluatepublic int getT()
public void setT(int t)
t
- the number of iterationspublic int getK()
public void setK(int k)
k
- the number of samplespublic double getLambda()
public void setLambda(double lambda)
lambda
- the learning ratepublic double getT0()
public void setT0(double t0)
t0
- the iteration offsetpublic boolean isBias()
public void setBias(boolean bias)
bias
- true if using a biaspublic int getNumplus()
public void setNumplus(int numplus)
numplus
- the number of positive samplespublic double[] getW()
public double getB()