parameters: (data, targetClass, otherClass = None, **args)
return_statement: return s2
docstring: A feature score for discrete data
      optional arguments:
      threshold
      fraction
docstring_summary: A feature score for discrete data
      optional arguments:
      threshold
      fraction
docstring_tokens: A feature score for discrete data optional arguments : threshold fraction
function: def usefullness(data, targetClass, otherClass = None, **args) :
      '''A feature score for discrete data
      optional arguments:
      threshold
      fraction
      '''
  
      if 'threshold' in args :
          threshold = args['threshold']
      else :
          threshold = 5
      if 'fraction' in args :
          fraction = args['fraction']
      else :
          fraction = 0.0
  
      Y, targetClassSize, otherClassSize, otherI, feature = parseArgs(
          data, targetClass, otherClass, **args)
  
      threshold = max(threshold, fraction * float(targetClassSize))        
  
      s1 = featureCount(data, targetClass=targetClass, Y=Y, feature=feature)
  
      s2 = featureCount(data, I = otherI, Y=Y,
                        feature=feature) / float(otherClassSize)
  
      s2 = 1 - s2
  
      numpy.putmask(s2, numpy.less(s1, threshold), 0.0)
  
      return s2
function_tokens: def usefullness ( data , targetClass , otherClass = None , * * args ) : if 'threshold' in args : threshold = args [ 'threshold' ] else : threshold = 5 if 'fraction' in args : fraction = args [ 'fraction' ] else : fraction = 0.0 Y , targetClassSize , otherClassSize , otherI , feature = parseArgs ( data , targetClass , otherClass , * * args ) threshold = max ( threshold , fraction * float ( targetClassSize ) ) s1 = featureCount ( data , targetClass = targetClass , Y = Y , feature = feature ) s2 = featureCount ( data , I = otherI , Y = Y , feature = feature ) / float ( otherClassSize ) s2 = 1 - s2 numpy . putmask ( s2 , numpy . less ( s1 , threshold ) , 0.0 ) return s2