How much time does take train SVM classifier?

后端 未结 1 785
小鲜肉
小鲜肉 2020-12-29 11:15

I wrote following code and test it on small data:

classif = OneVsRestClassifier(svm.SVC(kernel=\'rbf\'))
classif.fit(X, y)

Where X, y

1条回答
  •  孤城傲影
    2020-12-29 11:49

    SVM training can be arbitrary long, this depends on dozens of parameters:

    • C parameter - greater the missclassification penalty, slower the process
    • kernel - more complicated the kernel, slower the process (rbf is the most complex from the predefined ones)
    • data size/dimensionality - again, the same rule

    in general, basic SMO algorithm is O(n^3), so in case of 30 000 datapoints it has to run number of operations proportional to the2 700 000 000 000which is realy huge number. What are your options?

    • change a kernel to the linear one, 784 features is quite a lot, rbf can be redundant
    • reduce features' dimensionality (PCA?)
    • lower the C parameter
    • train model on the subset of your data to find the good parameters and then train the whole one on some cluster/supercomputer

    0 讨论(0)
提交回复
热议问题