Ceri Stagg avatar Ceri Stagg committed f1592bc

Strip out remaining debug print lines

Comments (0)

Files changed (1)

svmlight/svmlight.py

     if type(docobj) != tuple:
         raise Exception("document should be a tuple")
 
-    print ', '.join(map(str, docobj))
-
     label     = docobj[0]
     words_list = docobj[1]
     if len( docobj ) > 2:
             break 
         wordtuple = WordTuple( feature_pair[0], feature_pair[1] )
         words.append( wordtuple )
-        # print( "Feature pair wnum %r weight %r" % ( wordtuple.wnum, wordtuple.weight ) )
 
+    # sentinel entry required by C code
     words.append( WordTuple( 0, 0.0 ) )
 
     returnval = UnpackData( words, label, queryid, slackid, costfactor )
                 totwords = candidatewords
 
         docnum = unpackdata.doc_label
-        print( "Docnum %r" % (docnum) )
-     
-        print "Creating svector"
+
         fvec = create_svector( unpackdata.words, "", 1.0 )
-        print "....done svector."
+  
         currentsize = len( tempdoclist )
         newdoc = create_example_from_unpack( unpackdata, currentsize, fvec )
         pdoc = pointer( newdoc )
         tempdoclist.append( pdoc )
 
         locdoc = tempdoclist[-1].contents
-        print( "locdoc num %r" % (locdoc.docnum ) )
 
         templabellist.append( docnum )
 
     result.labels = carraylabel
     result.totwords = totwords
     result.totdoc = totdoc
-
-    for i in range ( 0, totdoc ):
-        pdoc = result.docs[i]
-        print( "Docnum %r %r" % ( pdoc.contents.docnum, pdoc ) )
      
     return result
 # ----------------------------------------------
     for item in words:
         result[ index ].wnum = item.wnum
         result[ index ].weight = item.weight
-        # print( "Converting %r %r" % ( result[ index ].wnum, result[ index ].weight ) )
         index += 1
 
     return result
     # ("words",       POINTER(WORD)),
 
     result.words = cwords
-    print( "create_svector" )
-    print( "Calling sprod_ss..." )
     result.twonorm_sq = svm.sprod_ss( pointer(result), pointer(result) )
-    print( "...done (twonorm_sq was %f)" % (result.twonorm_sq) )
 
     result.userdefined = generate_C_string_from_python( userdefined )
     result.factor = factor
     return result
 # ----------------------------------------------
 
-def print_client_data( client_data ):
-    verbosity = client_data.pverb
-    learn_parm = client_data.plearn
-    kernel_parm = client_data.kparm
-
-    print 'Kernel:'
-    print kernel_parm.kernel_type
-    print 'Verbosity:'
-    print verbosity
-    print 'C:'
-    print learn_parm.svm_c
-    print 'poly_degree:'
-    print kernel_parm.poly_degree
-    print 'rbf_gamma:'
-    print kernel_parm.rbf_gamma
-    print 'coef_lin:'
-    print kernel_parm.coef_lin
-    print 'coef_const:'
-    print kernel_parm.coef_const
-# ----------------------------------------------
-
 class CLIENTDATA(Structure):
     _fields_ = [("pverb",  c_long),
             ("plearn", LEARN_PARM),
             ("kparm",  KERNEL_PARM)]
 # ----------------------------------------------
-'''class DOCLISTDATA(Structure):
-    _fields_ = [("docs", POINTER(DOC)),
-                ("labels", POINTER(c_double)),
-                ("totwords",  c_int),
-                ("totdoc",  c_int)]'''
 
 SVMCallTuple = namedtuple('SVMCallTuple', 'doclistdata client_data kernel_cache model' )
 
     
     client_data = read_learning_parameters( **kwds )
 
-    print_client_data( client_data )
     doclistdata = unpack_doclist( doclist )
 
     model = MODEL()
 
-    print( "Initializing kernel." )
     kernel_cache = None
     if client_data.kparm.kernel_type != LINEAR:
         kernel_cache = svm.kernel_cache_init( doclistdata.totdoc, 
                                               client_data.plearn.kernel_cache_size )
-        
-
-    for i in range ( 0, doclistdata.totdoc ):
-        pdoc = doclistdata.docs[i]
-        print( "Docnum %r %r" % ( pdoc.contents.docnum, pdoc ) )
-
-    print( "Learn type: %r" % ( client_data.plearn.type ))
 
     svm_call_tuple = SVMCallTuple( doclistdata, client_data, kernel_cache, model )
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.