You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
2.1 KiB
53 lines
2.1 KiB
14 years ago
|
diff -up ./tools/easy.py.toolsDir ./tools/easy.py
|
||
12 years ago
|
--- ./tools/easy.py.toolsDir 2013-03-31 17:06:49.000000000 +1000
|
||
|
+++ ./tools/easy.py 2013-04-13 23:17:53.399526910 +1000
|
||
14 years ago
|
@@ -12,10 +12,10 @@ if len(sys.argv) <= 1:
|
||
|
|
||
|
is_win32 = (sys.platform == 'win32')
|
||
|
if not is_win32:
|
||
|
- svmscale_exe = "../svm-scale"
|
||
|
- svmtrain_exe = "../svm-train"
|
||
|
- svmpredict_exe = "../svm-predict"
|
||
|
- grid_py = "./grid.py"
|
||
|
+ svmscale_exe = "/usr/bin/svm-scale"
|
||
|
+ svmtrain_exe = "/usr/bin/svm-train"
|
||
|
+ svmpredict_exe = "/usr/bin/svm-predict"
|
||
|
+ grid_py = "/usr/bin/svm-grid.py"
|
||
|
gnuplot_exe = "/usr/bin/gnuplot"
|
||
|
else:
|
||
|
# example for windows
|
||
|
@@ -47,7 +47,7 @@ if len(sys.argv) > 2:
|
||
|
|
||
|
cmd = '{0} -s "{1}" "{2}" > "{3}"'.format(svmscale_exe, range_file, train_pathname, scaled_file)
|
||
|
print('Scaling training data...')
|
||
|
-Popen(cmd, shell = True, stdout = PIPE).communicate()
|
||
|
+Popen(cmd, shell = True, stdout = PIPE).communicate()
|
||
|
|
||
|
cmd = '{0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file)
|
||
|
print('Cross validation...')
|
||
|
@@ -70,10 +70,10 @@ print('Output model: {0}'.format(model_f
|
||
|
if len(sys.argv) > 2:
|
||
|
cmd = '{0} -r "{1}" "{2}" > "{3}"'.format(svmscale_exe, range_file, test_pathname, scaled_test_file)
|
||
|
print('Scaling testing data...')
|
||
|
- Popen(cmd, shell = True, stdout = PIPE).communicate()
|
||
|
+ Popen(cmd, shell = True, stdout = PIPE).communicate()
|
||
|
|
||
|
cmd = '{0} "{1}" "{2}" "{3}"'.format(svmpredict_exe, scaled_test_file, model_file, predict_test_file)
|
||
|
print('Testing...')
|
||
|
- Popen(cmd, shell = True).communicate()
|
||
|
+ Popen(cmd, shell = True).communicate()
|
||
|
|
||
|
print('Output prediction: {0}'.format(predict_test_file))
|
||
|
diff -up ./tools/grid.py.toolsDir ./tools/grid.py
|
||
12 years ago
|
--- ./tools/grid.py.toolsDir 2013-03-31 17:06:50.000000000 +1000
|
||
|
+++ ./tools/grid.py 2013-04-13 23:18:53.964522769 +1000
|
||
|
@@ -18,7 +18,7 @@ class GridOption:
|
||
|
def __init__(self, dataset_pathname, options):
|
||
|
dirname = os.path.dirname(__file__)
|
||
|
if sys.platform != 'win32':
|
||
|
- self.svmtrain_pathname = os.path.join(dirname, '../svm-train')
|
||
|
+ self.svmtrain_pathname = '/usr/bin/svm-train'
|
||
|
self.gnuplot_pathname = '/usr/bin/gnuplot'
|
||
|
else:
|
||
|
# example for windows
|