Package ml.shifu.guagua.example.lnr
Class LinearRegressionParams
- java.lang.Object
-
- ml.shifu.guagua.io.HaltBytable
-
- ml.shifu.guagua.example.lnr.LinearRegressionParams
-
- All Implemented Interfaces:
ml.shifu.guagua.io.Bytable
public class LinearRegressionParams extends ml.shifu.guagua.io.HaltBytableA model class to store linear regression weight on first iteration by usingparameters, while in other iterationsparametersis used to store gradients.To make all workers started at the same model, master will compute a consistent model weights at the first iteration and then send to all the workers. Workers will start computing from the second iteration.
Workers are responsible to compute local accumulated gradients and send to master while master accumulates all gradients together to build a global model.
-
-
Constructor Summary
Constructors Constructor Description LinearRegressionParams()LinearRegressionParams(double[] parameters)LinearRegressionParams(double[] parameters, double error)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoReadFields(DataInput in)voiddoWrite(DataOutput out)doublegetError()double[]getParameters()voidsetError(double error)voidsetParameters(double[] parameters)
-
-
-
Method Detail
-
getParameters
public double[] getParameters()
-
setParameters
public void setParameters(double[] parameters)
-
getError
public double getError()
-
setError
public void setError(double error)
-
doWrite
public void doWrite(DataOutput out) throws IOException
- Specified by:
doWritein classml.shifu.guagua.io.HaltBytable- Throws:
IOException
-
doReadFields
public void doReadFields(DataInput in) throws IOException
- Specified by:
doReadFieldsin classml.shifu.guagua.io.HaltBytable- Throws:
IOException
-
-