资源简介
libsvm gridregression.py
放在C:\libsvm-2.xx\python里面就可以了
代码片段和文件信息
#!/usr/bin/env python
# This gridregression.py is modified from grid.py in LIBSVM 3.17 version
__all__ = [‘find_parameters‘]
import os sys traceback getpass time re
from threading import Thread
from subprocess import *
if sys.version_info[0] < 3:
from Queue import Queue
else:
from queue import Queue
telnet_workers = []
ssh_workers = []
nr_local_worker = 1
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.gnuplot_pathname = ‘/usr/bin/gnuplot‘
else:
# example for windows
self.svmtrain_pathname = os.path.join(dirname r‘..\windows\svm-train.exe‘)
# svmtrain_pathname = r‘c:\Program Files\lib
- 上一篇:《think python》PDF
- 下一篇:Python贪吃蛇
评论
共有 条评论