SVM 的数据太多?

Too Much Data for SVM?

所以我 运行 在一个具有大约 120 个特征和 10,000 个观察值的数据帧上使用 sklearn 的 SVM 分类器(具有线性内核和概率假)。该程序需要数小时才能 运行 并且由于超出计算限制而不断崩溃。只是想知道这个数据框是否太大了?

您可以尝试更改算法的参数。

Tips on practical use from the documentation.

您可以尝试不同的算法,这里有一个作弊 sheet 您可能会觉得有用:

总之没有,这个一点都不大。线性 svm 可以扩展得更远。另一方面,libSVC 库不能。好消息是,即使在 scikit-learn 中,您也有大规模的 svm 实现——基于 liblinear 的 LinearSVC。您还可以使用 SGD(也可在 scikitlearn 中使用)解决它,它也将收敛于更大的数据集。

The implementation is based on libsvm. The fit time complexity is more than quadratic with the number of samples which makes it hard to scale to dataset with more than a couple of 10000 samples.

关于sklearn svm的官方数据告诉门槛是10,000个样本 所以 SGD 可能是更好的尝试。