libsvm icon indicating copy to clipboard operation
libsvm copied to clipboard

use python/libsvm twice get different value

Open cristianoandy opened this issue 5 years ago • 1 comments

train_label = trainlabel[:] train_data = traindata[:] cmd = '-v 3 -c 0.5 -g 0.5 -h 0' cmd1 = '-v 3 -c 0.5 -g 0.5 -h 0' model = svm_train(trainlabel,traindata,cmd) model1 = svm_train(train_label, train_data, cmd1) When I run this code, the model is not equal to model1.

cristianoandy avatar Apr 23 '19 13:04 cristianoandy

For cross validation (-v) data are randomly split so you got different results. On 2019-04-23 06:53, cristianoandy wrote:

train_label = trainlabel[:] train_data = traindata[:] cmd = '-v 3 -c 0.5 -g 0.5 -h 0' cmd1 = '-v 3 -c 0.5 -g 0.5 -h 0' model = svm_train(trainlabel,traindata,cmd) model1 = svm_train(train_label, train_data, cmd1) When I run this code, the model is not equal to model1.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub [1], or mute the thread [2]. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/cjlin1/libsvm/issues/142", "url": "https://github.com/cjlin1/libsvm/issues/142", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Links:

[1] https://github.com/cjlin1/libsvm/issues/142 [2] https://github.com/notifications/unsubscribe-auth/ABI3BHWYNCSHBPHQLFU5MFLPR4IELANCNFSM4HHYFVWA

cjlin1 avatar Apr 23 '19 18:04 cjlin1