From: LILLYS hernandez on 27 May 2010 04:31 HI!!! i´m using svmtrain to classify in groups, but i dont know how to find w and b parameters in the hiperplane formula. taking the fisheriris example, can someone help me? thank you.
From: Arthur Goldsipe on 27 May 2010 10:41 "LILLYS hernandez" <rahelish(a)hotmail.com> wrote in message <htlakp$sdl$1(a)fred.mathworks.com>... > HI!!! > i´m using svmtrain to classify in groups, but i dont know how to find w and b parameters in the hiperplane formula. taking the fisheriris example, can someone help me? > thank you. Hi, Your question is complicated by several details. First, svmtrain by default will use autoscaling, which means the data will be centered and scaled so that each feature has a mean of zero and a variance of zero. Therefore, I need to clarify that the answer I give you will be in terms of the centered and scaled feature space. Also, in general, svmtrain supports nonlinear kernels, so the definition of w and b in those cases in a bit more complicated. So let me restrict my answer to the default linear kernel, since that's probably what you want. Given those caveats, you can calculate w and b from the output structure from svmtrain as follows: % svmStruct = svmtrain(...) w = svmStruct.Alpha'*svmStruct.SupportVectors; b = svmStruct.Bias Note that the convention here is that the hyperplane is defined by the equation w*x + b = 0. I hope that answers your question! -Arthur
|
Pages: 1 Prev: different behavior when using matlab compiled dll Next: 'SC' function: RGB to Data |