I see a function passing like
sigma = 3*e-2
svmTrain(...,@(X,y)gaussianKernel(X,y,sigma),...);
What is going on with such a function passing, would someone explain ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The syntax
@(X,y) gaussianKernel(X, y, sigma)creates an anonymous function by binding the third argument of this existing functionguassianKernel(X, y, s)to specifically be the valuesigma.If you inspect the
svmTrainfunction signature, you’ll see that it allows passing in a function, which is where this anonymous function is going.