import os, sys, traceback
from threading import Thread
if(sys.hexversion < 0x03000000):
is_win32 = (sys.platform == 'win32')
svmtrain_exe = "../svm-train"
gnuplot_exe = "/usr/bin/gnuplot"
c_begin, c_end, c_step = -1, 6, 1
g_begin, g_end, g_step = 0, -8, -1
p_begin, p_end, p_step = -8, -1, 1
global dataset_pathname, dataset_title, pass_through_string
global out_filename, png_filename
def process_options(argv=sys.argv):
global c_begin, c_end, c_step
global g_begin, g_end, g_step
global p_begin, p_end, p_step
global dataset_pathname, dataset_title, pass_through_string
global svmtrain_exe, gnuplot_exe, gnuplot, out_filename, png_filename
Usage: grid.py [-log2c begin,end,step] [-log2g begin,end,step] [-log2p begin,end,step] [-v fold]
[-svmtrain pathname] [-gnuplot pathname] [-out pathname] [-png pathname]
[additional parameters for svm-train] dataset"""
dataset_pathname = argv[-1]
dataset_title = os.path.split(dataset_pathname)[1]
out_filename = '%s.out' % dataset_title
png_filename = '%s.png' % dataset_title
pass_through_options = []
(c_begin,c_end,c_step) = map(float,argv[i].split(","))
elif argv[i] == "-log2g":
(g_begin,g_end,g_step) = map(float,argv[i].split(","))
elif argv[i] == "-log2p":
(p_begin,p_end,p_step) = map(float,argv[i].split(","))
elif argv[i] in ('-c','-g'):
print("Option -c and -g are renamed.")
elif argv[i] == '-svmtrain':
elif argv[i] == '-gnuplot':