Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refine arguments

  • Loading branch information...
commit 114342747eaf4e5719745c0cd113272e3c4c51ba 1 parent b3b768c
@epico epico authored
Showing with 5 additions and 5 deletions.
  1. +2 −2 reduce.py
  2. +3 −3 tryprune.py
View
4 reduce.py
@@ -48,7 +48,7 @@ def iterateSubDirectory(oldroot, newroot, level):
if __name__ == '__main__':
parser = ArgumentParser(description='Reduce the levels of categories.')
parser.add_argument('--level', action='store', default=2, \
- help='reduce to n levels of index')
+ help='reduce to n levels of index', type=int)
parser.add_argument('origdir', action='store', \
help='original index directory')
parser.add_argument('--destdir', action='store', \
@@ -57,5 +57,5 @@ def iterateSubDirectory(oldroot, newroot, level):
args = parser.parse_args()
print(args)
- iterateSubDirectory(args.origdir, args.destdir, int(args.level))
+ iterateSubDirectory(args.origdir, args.destdir, args.level)
print('done')
View
6 tryprune.py
@@ -83,15 +83,15 @@ def pruneModel(modelfile, k, CDF):
parser.add_argument('--mergenumber', action='store', \
help='number of documents to be merged', \
- default='10')
+ default=10, type=int)
parser.add_argument('-k', action='store', \
help='k parameter of k mixture model prune', \
- default='3')
+ default=3, type=int)
parser.add_argument('--CDF', action='store', \
help='CDF parameter of k mixture model prune', \
- default='0.99')
+ default=0.99, type=float)
parser.add_argument('tryname', action='store', \
help='the storage directory')
Please sign in to comment.
Something went wrong with that request. Please try again.