简体   繁体   English

使用 scikit-learn 的 SGDClassifier 实现 SVM:如何调整正则化参数?

[英]Using scikit-learn's SGDClassifier to implement SVM: how to tune the regularization parameter?

I am using scikit-learn library to implement SVM for a large-size dataset (300-400K samples with <100 features).我正在使用scikit-learn库为大型数据集(具有 <100 个特征的 300-400K 样本)实现 SVM。 To cope with the size issue, I am using SGDClassifier rather than libsvm , however I am not aware of any argument/parameter so that I can tune the regularization parameter within SGDClassifier .为了解决大小问题,我使用SGDClassifier而不是libsvm ,但是我不知道任何参数/参数,以便我可以调整SGDClassifier的正则化参数。 Can anybody help me with this?有人可以帮我解决这个问题吗?

Thanks, Soheil谢谢,索黑尔

You have to use the arguments - penalty and alpha.您必须使用参数 - 惩罚和 alpha。 And l1_ratio if you consider elastic net.如果您考虑弹性网,则为 l1_ratio。

Look at this看这个

https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM