dataset3Params.m 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. function [C, sigma] = dataset3Params(X, y, Xval, yval)
  2. %DATASET3PARAMS returns your choice of C and sigma for Part 3 of the exercise
  3. %where you select the optimal (C, sigma) learning parameters to use for SVM
  4. %with RBF kernel
  5. % [C, sigma] = DATASET3PARAMS(X, y, Xval, yval) returns your choice of C and
  6. % sigma. You should complete this function to return the optimal C and
  7. % sigma based on a cross-validation set.
  8. %
  9. % You need to return the following variables correctly.
  10. C = 1;
  11. sigma = 0.1;
  12. % ====================== YOUR CODE HERE ======================
  13. % Instructions: Fill in this function to return the optimal C and sigma
  14. % learning parameters found using the cross validation set.
  15. % You can use svmPredict to predict the labels on the cross
  16. % validation set. For example,
  17. % predictions = svmPredict(model, Xval);
  18. % will return the predictions on the cross validation set.
  19. %
  20. % Note: You can compute the prediction error using
  21. % mean(double(predictions ~= yval))
  22. %
  23. % =========================================================================
  24. end