我有1毫升任务,34461个样本,我使用LinearRegressionWithSGD来训练模型。但是两个训练结果(MSE和相关)的结果是相同的:
列车模型(setNumIterations( 5 ))
val linearRegressionWithSGD: LinearRegressionWithSGD = new LinearRegressionWithSGD()
linearRegressionWithSGD.setIntercept(true)
linearRegressionWithSGD.optimizer.setStepSize(0.1)
linearRegressionWithSGD.optimizer.setNumIterations(5)
列车模型(setNumIterations( 10000 ))
val linearRegressionWithSGD: LinearRegressionWithSGD = new LinearRegressionWithSGD()
linearRegressionWithSGD.setIntercept(true)
linearRegressionWithSGD.optimizer.setStepSize(0.1)
linearRegressionWithSGD.optimizer.setNumIterations(10000)
我无法控制迭代次数,但为什么?