Spark-ML 線性回歸 LinearRegression (1)
LinearRegression參數(shù)詳述:
1. 正則化參數(shù)-Regparam:(Double)默認(rèn)值為0.0
Regparam:The Regularization Parameter.,Default Is 0.0
@Since(“1.3.0”)
2. 適應(yīng)截距-FitIntercept:(Boolean)如果我們應(yīng)該適應(yīng)截距嘉冒,默認(rèn)值為true。
FitIntercept:if we should fit the intercept,Default is true.
@Since(“1.5.0”)
3. 培訓(xùn)功能-Standardization:在擬合模型之前是否規(guī)范培訓(xùn)功能咆繁,默認(rèn)為true讳推。
Standardization:Whether to standardize the training features before fitting the model,Default is true.
@Since(“1.5.0”)
4. 混合參數(shù)-ElasticNetParam:(Double)
對(duì)于α= 0,懲罰是L2懲罰么介。
對(duì)于α= 1娜遵,它是一個(gè)L1懲罰。
對(duì)于(0,1)中的α壤短,懲罰是L1和L2的組合设拟。
默認(rèn)值為0.0慨仿,這是一個(gè)L2懲罰。
ElasticNetParam:Set the ElasticNet mixing parameter.0 for L2 penalty,1 for L1 penalty,(0,1) for a combination of L1 and L2.Default is 0.0
@Since(“1.4.0”)
5. 最大迭代次數(shù)-MaxIter:最大迭代次數(shù)纳胧。默認(rèn)值為100镰吆。
MaxIter:the maximum number of iterations,Default is 100.
@Since(“1.3.0”)
6. 迭代的收斂公差-Tol:(Double)設(shè)置迭代的收斂公差。
更小的價(jià)值將導(dǎo)致更高的準(zhǔn)確性與更多的迭代的成本跑慕。默認(rèn)為1E-6万皿。
Tol:the convergence tolerance of iterations.Default is 1E-6.
@Since(“1.4.0”)
7. 權(quán)重-WeightCol:(String)是否根據(jù)給定的權(quán)重weightCol進(jìn)行過度/低于樣本的訓(xùn)練實(shí)例。
如果沒有set或?yàn)榭蘸诵校瑒t所有實(shí)例都被平等對(duì)待(重量為1.0)牢硅。
默認(rèn)沒有set,所以所有的實(shí)例都有權(quán)重芝雪。
WeightCol:Whether to over-/under-sample training instances according to the given weights in weightCol,Default is weight 1.0.
val w = if (!isDefined(weightCol) || $(weightCol).isEmpty) lit(1.0) else col($(weightCol))
@Since(“1.6.0”)
8. 求解算法-Solver:(String)設(shè)置用于優(yōu)化的求解算法减余。
在線性回歸的情況下,這可以是“l(fā)-bfgs”惩系,“normal”和“auto”位岔。
“l(fā)-bfgs”表示有限存儲(chǔ)器BFGS,其是有限存儲(chǔ)器的準(zhǔn)牛頓優(yōu)化方法堡牡。
“normal”表示使用正態(tài)方程作為線性回歸問題的解析解抒抬。 此求解器僅限于“LinearRegression.MAX_FEATURES_FOR_NORMAL_SOLVER”。
“auto”(默認(rèn))表示自動(dòng)選擇求解器算法晤柄。 正常方程式求解器將在可能的情況下使用擦剑,但在需要時(shí)會(huì)自動(dòng)回退到迭代優(yōu)化方法。
@Since(“1.6.0”)
9. 建議樹的聚集的深度-AggregationDepth:(Int)建議樹的聚集(大于或等于2)的深度芥颈。
如果功能的尺寸或分區(qū)數(shù)量較大抓于,
這個(gè)參數(shù)可以調(diào)整到更大的尺寸。
默認(rèn)值為2浇借。
@Since(“2.1.0”)
來自 http://blog.csdn.net/qq_24734217/article/details/75476729