docs/algo/robust_on_angel.md
鲁棒回归模型(robust regression model)同样是对一个或多个自变量与一个因变量之间的关系进行建模,不同点在于其旨在克服传统参数和非参数方法的一些局限性,如普通最小二乘法的假设条件不成立时会产生误导性结果,而鲁棒回归则旨在不会受到基础数据生成过程违反假设的过度影响。
鲁棒回归模型(robust regression model)是一种对异常值比较健壮的回归模型。给一个随机样本 , 常规的线性回归模型假设回归子和回归量 之间的关系是除了X的影响以外,还存在一个服从正态分布的误差项来捕获除了 之外任何对的影响,但如果误差项是由非正常测量误差或其他违反标准假设引起的,那么常规的线性回归模型的有效性会受到影响。鲁棒回归模型在这方面进行了改进,允许方差取决于自变量X,一个多变量鲁棒回归模型表示为以下的形式:
鲁棒回归模型使用Huber损失函数,其对残差进行分段,对不同段的残差使用不同的损失计算方式,目标函数如下所示:
其中:为一组样本的预测。该方法结合了平方损失和绝对损失,避免了被特别大的异常值支配。
Angel MLLib提供了用Mini-Batch Gradient Descent优化方法求解的Robust Regression算法,其算法逻辑如下,其中
其说明如下:
其中, α为衰减系数, T为迭代次数
算法参数
输入输出参数
资源参数
提交命令
./bin/angel-submit \
--action.type=train \
--angel.app.submit.class=com.tencent.angel.ml.core.graphsubmit.GraphRunner \
--ml.model.class.name=com.tencent.angel.ml.regression.RobustRegression \
--angel.train.data.path=$input_path \
--angel.save.model.path=$model_path \
--angel.log.path=$log_path \
--ml.data.is.classification=false \
--ml.model.is.classification=false \
--ml.robustregression.loss.delta=1.0 \
--ml.epoch.num=10 \
--ml.feature.index.range=$featureNum+1 \
--ml.data.validate.ratio=0.1 \
--ml.learn.rate=0.1 \
--ml.reg.l2=0.001 \
--ml.data.type=libsvm \
--ml.model.type=T_FLOAT_DENSE \
--ml.num.update.per.epoch=10 \
--ml.worker.thread.num=4 \
--angel.workergroup.number=2 \
--angel.worker.memory.mb=5000 \
--angel.worker.task.number=1 \
--angel.ps.number=2 \
--angel.ps.memory.mb=5000 \
--angel.job.name=robustReg_network \
--angel.output.path.deleteonexist=true
./bin/angel-submit \
--action.type=train \
--angel.app.submit.class=com.tencent.angel.ml.core.graphsubmit.GraphRunner \
--ml.model.class.name=com.tencent.angel.ml.regression.RobustRegression \
--angel.train.data.path=$input_path \
--angel.load.model.path=$model_path \
--angel.save.model.path=$model_path \
--angel.log.path=$log_path \
--ml.data.is.classification=false \
--ml.model.is.classification=false \
--ml.robustregression.loss.delta=1.0 \
--ml.epoch.num=10 \
--ml.feature.index.range=$featureNum+1 \
--ml.data.validate.ratio=0.1 \
--ml.learn.rate=0.1 \
--ml.reg.l2=0.001 \
--ml.data.type=libsvm \
--ml.model.type=T_FLOAT_DENSE \
--ml.num.update.per.epoch=10 \
--ml.worker.thread.num=4 \
--angel.workergroup.number=2 \
--angel.worker.memory.mb=5000 \
--angel.worker.task.number=1 \
--angel.ps.number=2 \
--angel.ps.memory.mb=5000 \
--angel.job.name=robustReg_network \
--angel.output.path.deleteonexist=true
./bin/angel-submit \
--action.type=predict \
--angel.app.submit.class=com.tencent.angel.ml.core.graphsubmit.GraphRunner \
--ml.model.class.name=com.tencent.angel.ml.regression.RobustRegression \
--angel.predict.data.path=$input_path \
--angel.load.model.path=$model_path \
--angel.predict.out.path=$predict_path \
--angel.log.path=$log_path \
--ml.feature.index.range=$featureNum+1 \
--ml.data.type=libsvm \
--ml.model.type=T_FLOAT_DENSE \
--ml.worker.thread.num=4 \
--angel.workergroup.number=2 \
--angel.worker.memory.mb=5000 \
--angel.worker.task.number=1 \
--angel.ps.number=2 \
--angel.ps.memory.mb=5000 \
--angel.job.name=robustReg_network \
--angel.output.path.deleteonexist=true