selecting c and gamma value

前端 未结 4 2198
旧巷少年郎
旧巷少年郎 2021-02-08 15:33

Hi I am performing SVM classification using SMO, in which my kernel is RBF, now I want to select c and sigma values, using grid search and cros

4条回答
  •  旧时难觅i
    2021-02-08 16:13

    1. Pick some values for C and sigma that you think are interesting. E.g., C = {1, 10, 100, 1000} and sigma = {.01, .1, 1} (I'm just making these up).
    2. Divide the training set into k (e.g. 10) parts, preferably in a stratified way.
    3. Loop over all pairs of C and sigma values.
      1. Loop over all k parts of your training set. Hold the k'th part out. Train a classifier on all of the other parts combined, then test on the held out part.
      2. Keep track of some score (accuracy, F1, or whatever you want to optimize).
    4. Return the best performing value pair for C, sigma by the scores you just computed.

提交回复
热议问题