MzeroMiko / SVM_SVC_SVR

SVMs in The Nature of Statistical Learning Theory by Vapnik
1 stars 0 forks source link

About Huber SVR #1

Open mibo0 opened 2 years ago

mibo0 commented 2 years ago

Dear rabbit, can you tell me how the hubersvr on your side finally completed the prediction, because I haven't seen how to bring the training set and test set into the calculation respectively. If you do a separate document like the one called in sklearn, I will be very grateful!

MzeroMiko commented 2 years ago

I am glad that you can pay attention to this repo. Actually, this is a very early project I've written just as a part of note reading . I would like to add one readme.md and renew the code one day. As for this version (even without a readme.md or comments ), "huberSVR(x, y, kernel, C, eta, maxIter, uc)" needs you input train data into "x", and "y" infers the labels fits the training data; "kernel" means kernel function, should be type "lambda x,x1:out"; "C" is the tolerate parameter and "eta" / "uc" is the boundary describing how close to 0 or C; maxIter refers max iteration. This function would finally returns f, a, b. While "a" means alphas, "b" means bias, "f" is a anonymous function that receives TEST DATA as input, and returns the label one sample should be tagged. So you just need to type "func, , = huberSVR(TRAIN_DATA, labels, ...); pred = func(TEST_DATA)", that may works for you. For detailed usage you can see "SVR_test.py".

mibo0 commented 2 years ago

How can I choose these two values of maxIter,uc? I think svr doesn't have these two values in mathematical reasoning. If it is convenient, can you leave a contact information, for example wechat or QQ?I will be very grateful!

mibo0 commented 2 years ago

I now understand that you have completed the iterative process of smo on your own. The bunny is amazing, but if you use cvxopt or gurobi to solve the qpp problem here, I think your model will be more perfect!

MzeroMiko commented 2 years ago

"maxIter" can be assigned by 100, 1000, or even bigger number you like, just as the performance meets your need. "uc" can be 1e-3 1e-4 or even smaller number you like, but the smaller "uc" is, the slower the program would run. it's not a key parameter for svm, so take it easy.
I would take your advice into consideration, thank you.