⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 library for SVMclassification and regression. It solves C-SVM classification, nu-SVM classification
💻
字号:
This directory includes some useful codes:1. subset selection tools.2. parameter selection tools.3. LIBSVM format checking toolsPart I: Subset selection toolsIntroduction============Training large data is time consuming. Sometimes one should work on asmaller subset first. The python script subset.py randomly selects aspecified number of samples. For classification data, we provide astratified selection to ensure the same class distribution in thesubset.Usage: subset.py [options] dataset number [output1] [output2]This script selects a subset of the given data set.options:-s method : method of selection (default 0)     0 -- stratified selection (classification only)     1 -- random selectionoutput1 : the subset (optional)output2 : the rest of data (optional)If output1 is omitted, the subset will be printed on the screen.Example=======> python subset.py heart_scale 100 file1 file2From heart_scale 100 samples are randomly selected and stored infile1. All remaining instances are stored in file2.Part II: Parameter Selection ToolsIntroduction============grid.py is a parameter selection tool for C-SVM classification usingthe RBF (radial basis function) kernel. It uses cross validation (CV)technique to estimate the accuracy of each parameter combination inthe specified range and helps you to decide the best parameters foryour problem.grid.py directly executes libsvm binaries (so no python binding is needed)for cross validation and then draw contour of CV accuracy using gnuplot.You must have libsvm and gnuplot installed before using it. The package gnuplot is available at http://www.gnuplot.info/On Mac OSX, the precompiled gnuplot file needs the library Aquarterm,which thus must be installed as well. In addition, this version ofgnuplot does not support png, so you need to change "set term pngtransparent small" and use other image formats. For example, you mayhave "set term pbm small color".Usage: grid.py [-log2c begin,end,step] [-log2g begin,end,step] [-v fold]        [-svmtrain pathname] [-gnuplot pathname] [-out pathname] [-png pathname]         [additional parameters for svm-train] datasetThe program conducts v-fold cross validation using parameter C (and gamma) = 2^begin, 2^(begin+step), ..., 2^end. You can specify where the libsvm executable and gnuplot are using the-svmtrain and -gnuplot parameters.For windows users, please use pgnuplot.exe. If you are using gnuplot3.7.1, please upgrade to version 3.7.3 or higher. The version 3.7.1has a bug. If you use cygwin on windows, please use gunplot-x11.Example=======> python grid.py -log2c -5,5,1 -log2g -4,0,1 -v 5 -m 300 heart_scaleUsers (in particular MS Windows users) may need to specify the path ofexecutable files. You can either change paths in the beginning ofgrid.py or specify them in the command line. For example,> grid.py -log2c -5,5,1 -svmtrain c:\libsvm\windows\svmtrain.exe -gnuplot c:\tmp\gnuplot\bin\pgnuplot.exe -v 10 heart_scaleOutput: two filesdataset.png: the contour plot of the CV accuracy (generated by gnuplot)dataset.out: the log of accuracy at each (C,gamma)Parallel grid search (experimental)===================================You can conduct a parallel grid search by dispatching jobs to a cluster of computers which share the same file system. First, you add machine names in grid.py:telnet_workers = ["linux1", "linux5", "linux5"]The same machine (e.g., linux5 here) can be listed more than once ifit has multiple CPUs or has more RAM. If the local machine is thebest, you can also enlarge the nr_local_worker. For example:nr_local_worker = 2Example:> python grid.py heart_scalePassword: ********login ok linux1login ok linux5login ok linux5...The password is the one used for entering your system. If -log2c, -log2g, or-v is not specified, default values are used. If your system uses ssh instead of telnet, you should setup ssh first so thatthe authentication works without asking a password, and list the computer namesin ssh_workers.Part III: LIBSVM format checking toolsIntroduction============`svm-train' conducts only a simple check of the input data. To do adetailed check, we provide a python script `checkdata.py.'Usage: checkdata.py dataset This tool is written by Rong-En Fan at National Taiwan University.Example=======> cat bad_data1 3:1 2:4> python checkdata.py bad_dataline 1: feature indices must be in an ascending order, previous/current features 3:1 2:4Found 1 lines with error.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -