util.py
def rewrite_train():
  """
  Rewrites train.libsvm into a gzipped, pickled sparse matrix for the features,
  and a gzipped, pickled numpy (0-1) array for the labels.
  Run this once.
  
  Params: none
  
  Returns: 
    nothing, but writes out the transformed input files at data/
  """
  inpath = os.path.join(DATA, 'train.libsvm')
  (x, ylist) = load_svmlight_file(inpath, 
                                  n_features=NFEATURES, 
                                  multilabel=True, 
                                  zero_based=False)
  with gzip.open(XTRAIN, 'wb') as fx:
    cPickle.dump(x, fx)
  y = list2matrix(ylist)
  with gzip.open(YTRAIN, 'wb') as fy:
    cPickle.dump(y, fy)

  Rewrites train.libsvm into a gzipped, pickled sparse matrix for the features,
  and a gzipped, pickled numpy (0-1) array for the labels.
  Run this once.
  
  Params: none
  
  Returns: 
    nothing, but writes out the transformed input files at data/
  
Rewrites train.libsvm into a gzipped, pickled sparse matrix for the features,
and a gzipped, pickled numpy (0-1) array for the labels.
Run this once.

none
Rewrites train . libsvm into a gzipped pickled sparse matrix for the features and a gzipped pickled numpy ( 0 - 1 ) array for the labels . Run this once . none
def rewrite_train():
  inpath = os.path.join(DATA, 'train.libsvm')
  (x, ylist) = load_svmlight_file(inpath, 
                                  n_features=NFEATURES, 
                                  multilabel=True, 
                                  zero_based=False)
  with gzip.open(XTRAIN, 'wb') as fx:
    cPickle.dump(x, fx)
  y = list2matrix(ylist)
  with gzip.open(YTRAIN, 'wb') as fy:
    cPickle.dump(y, fy)
def rewrite_train ( ) : inpath = os . path . join ( DATA , 'train.libsvm' ) ( x , ylist ) = load_svmlight_file ( inpath , n_features = NFEATURES , multilabel = True , zero_based = False ) with gzip . open ( XTRAIN , 'wb' ) as fx : cPickle . dump ( x , fx ) y = list2matrix ( ylist ) with gzip . open ( YTRAIN , 'wb' ) as fy : cPickle . dump ( y , fy )
Rewrites train.libsvm into a gzipped, pickled sparse matrix for the features,
and a gzipped, pickled numpy (0-1) array for the labels.
Rewrites train . libsvm into a gzipped pickled sparse matrix for the features and a gzipped pickled numpy ( 0 - 1 ) array for the labels .
"""
  Rewrites train.libsvm into a gzipped, pickled sparse matrix for the features,
  and a gzipped, pickled numpy (0-1) array for the labels.
  Run this once.
  
  Params: none
  
  Returns: 
    nothing, but writes out the transformed input files at data/
  """
nothing, but writes out the transformed input files at data
nothing but writes out the transformed input files at data