summaryrefslogtreecommitdiffstats
path: root/tryprune.py
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-07-26 10:49:05 +0800
committerPeng Wu <alexepico@gmail.com>2011-07-26 10:49:05 +0800
commitef069f2ebb9b3e12b1b77d9ccee7f85bbceabe46 (patch)
tree6c8037990100d3297200e4f6b9de3e29a9694665 /tryprune.py
parentee0607586c243def746d3ae8eb0555f0696e57de (diff)
downloadtrainer-ef069f2ebb9b3e12b1b77d9ccee7f85bbceabe46.tar.gz
trainer-ef069f2ebb9b3e12b1b77d9ccee7f85bbceabe46.tar.xz
trainer-ef069f2ebb9b3e12b1b77d9ccee7f85bbceabe46.zip
clean up comments
Diffstat (limited to 'tryprune.py')
-rwxr-xr-xtryprune.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tryprune.py b/tryprune.py
index 4a85b79..459e4ed 100755
--- a/tryprune.py
+++ b/tryprune.py
@@ -23,7 +23,7 @@ def validateModel(modelfile):
modelfile]
subprocess = Popen(cmdline, shell=False, close_fds=True)
- #check os.waitpid doc
+
(pid, status) = os.waitpid(subprocess.pid, 0)
if status != 0:
sys.exit('Corrupted model found when validating:' + modelfile)
@@ -42,7 +42,6 @@ def exportModel(modelfile, textmodel):
f.writelines(subprocess.stdout.readlines())
f.close()
- #check os.waitpid doc
(pid, status) = os.waitpid(subprocess.pid, 0)
if status != 0:
sys.exit('Corrupted model found when exporting:' + modelfile)
@@ -85,7 +84,7 @@ def mergeOneModel(mergedmodel, onemodel, score):
onemodel]
subprocess = Popen(cmdline, shell=False, close_fds=True)
- #check os.waitpid doc
+
(pid, status) = os.waitpid(subprocess.pid, 0)
if status != 0:
sys.exit('Corrupted model found when merging:' + onemodel)
@@ -103,7 +102,7 @@ def mergeSomeModels(mergedmodel, sortedindexname, mergenum):
(subdir, modelname, score) = line.split('#', 2)
score = float(score)
if score > last_score:
- raise AssertionError('score must be descending.\n')
+ raise AssertionError('scores must be descending.\n')
onemodel = os.path.join(config.getModelDir(), subdir, modelname)
mergeOneModel(mergedmodel, onemodel, score)
@@ -121,7 +120,7 @@ def pruneModel(prunedmodel, k, CDF):
prunedmodel]
subprocess = Popen(cmdline, shell=False, close_fds=True)
- #check os.waitpid doc
+
(pid, status) = os.waitpid(subprocess.pid, 0)
if (status != 0):
sys.exit('Corrupted model found when pruning:' + modelfile)