常用於大規模稀疏機器學習問題上
1.優點:
高效
簡單
2.可以選擇損失函數
- loss=”hinge”: (soft-margin)線性SVM.
- loss=”modified_huber”: 帶平滑的hinge loss.
- loss=”log”: logistic回歸
3.通過penalty參數,可以設置對應的懲罰項。SGD支持下面的罰項:
- penalty=”l2”: 對coef_的L2范數罰項
- penalty=”l1”: 對coef_的L1范數罰項
- penalty=”elasticnet”: L2和L1的convex組合; (1 - l1_ratio) * L2 + l1_ratio * L1
詳見:http://d0evi1.com/sklearn/sgd/