Current location - Trademark Inquiry Complete Network - Futures platform - How to set the path of libsvm in WEKA
How to set the path of libsvm in WEKA
Unzip drive C: C:\libsvm-3. 182.

To use the script grid. pye easy. py that comes with libsvm, you need to load the drawing tool gnuplot in official website, decompress the C disk, enter the directory c:\libsvm\tools, modify the grid. pye easy. py file with a text editor (notepad editor), find the path item about gnuplot, and save it after modifying it according to the actual path.

Python connects with libsvm (refer to svm study notes (2) using 2)LIBSVMpython)

1. type IDLE(pythonGUI) and type >; & gt& gtimportsys & gt& gt& gtsys. Version

2.python32 characters:

(default, apr102012,23: 31:26) [mscv.150032 bit (Intel)]'

Wait for LIBSVMpython interface to set up non-simple libsvm-3. 16 folder windows folder state lookup link library libsvm.dll adds system directory `c c: \ Windows \ System32 \', that is, python uses libsvm.

wk _ ad _ begin({ PID:2 1 }); wk_ad_after(2 1,function(){$('。 ad-hidden)。 hide(); },function(){$('。 ad-hidden)。 show(); });

3. Implementation example

imported goods

Os.chdir ('c: \ libsvm-3.18 \ python') # Please modify it according to the actual path.

fromsvmutilimport *

Y, x = SVM reading problem ('.. /heart _ scale') # Read your own data.

m=svm_train(y[:200],x[:200],'-c4 ')

p_label,p_acc,p_val=svm_predict(y[200:],x[200:],m)

# # The optimization should be installed on the existing node, # ITER = 257NU = 0.351161.

obj=-225.628984,rho = 0.636 1 10 nsv = 9 1,nBSV=49

TotalnSV=9 1

Accuracy =84.2857%(59/70) (classification)

F