public abstract class SgdSvm
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected double |
alpha |
protected long |
dataLoadingTime |
protected int |
features |
protected boolean |
isInvalid |
protected int |
iterations |
protected int |
samples |
protected long |
testingTime |
protected long |
trainingTime |
protected double[] |
w |
protected double[] |
x |
protected double[][] |
xBatch |
protected double |
y |
protected double[] |
yBatch |
Constructor and Description |
---|
SgdSvm(double[] w,
double[][] x,
double[] y,
double alpha,
int iterations)
This constructor is initialized for Batch based SGD SVM
|
SgdSvm(double[] x,
double y,
double alpha,
int iterations) |
SgdSvm(double[] w,
double alpha,
int iterations,
int features)
This constructor is initialized for Streaming based SGD SVM
|
Modifier and Type | Method and Description |
---|---|
double[] |
getW() |
abstract void |
iterativeSgd(double[] w1,
double[][] x1,
double[] y1) |
abstract void |
iterativeTaskSgd(double[] w1,
double[][] x1,
double[] y1) |
abstract <T> void |
onlineDynamicSGD(T[] w1,
T[] x1,
T y1) |
abstract void |
onlineSGD(double[] w1,
double[] x1,
double y1) |
void |
setW(double[] w) |
abstract void |
sgd()
Deprecated.
method
Use iterativeSGD for batch mode training
Use onlineSGD for streaming mode training
|
protected double[] x
protected double y
protected double[][] xBatch
protected double[] yBatch
protected double alpha
protected int features
protected int samples
protected boolean isInvalid
protected double[] w
protected int iterations
protected long trainingTime
protected long testingTime
protected long dataLoadingTime
public SgdSvm(double[] x, double y, double alpha, int iterations)
public SgdSvm(double[] w, double[][] x, double[] y, double alpha, int iterations)
w
- initial weights (random Gaussian Distribution)x
- data pointsy
- labels for corresponding data pointsalpha
- learning rate : default = 0.001iterations
- number of iterations to run the SGD SVMpublic SgdSvm(double[] w, double alpha, int iterations, int features)
w
- initial weightalpha
- learning rate : default 0.001iterations
- number of iterationsfeatures
- number of features in a data point@Deprecated public abstract void sgd() throws NullDataSetException, MatrixMultiplicationException
public abstract void iterativeSgd(double[] w1, double[][] x1, double[] y1) throws NullDataSetException, MatrixMultiplicationException
public abstract void iterativeTaskSgd(double[] w1, double[][] x1, double[] y1) throws NullDataSetException, MatrixMultiplicationException
public abstract void onlineSGD(double[] w1, double[] x1, double y1) throws NullDataSetException, MatrixMultiplicationException
public abstract <T> void onlineDynamicSGD(T[] w1, T[] x1, T y1)
public double[] getW()
public void setW(double[] w)