eval.py
def dvByLabel(y, dv):
  """
  Find the median decision values for the positive and negative instances
  of each class.
  This function is used for exploratory data analysis/model evaluation.
  
  Params:
    y - the 0-1 label matrix; a numpy array
    dv - array of decision values returned from a model; a numpy array

  Returns:
    a pandas data frame of size (# classes) x 3 with the median
    decision value on negative instances for class k in position [k, 0],
    the median positive decision value in [k, 1], and the count 
    of class k positives in [k, 2]
  """
  dv = as_float_array(dv)
  result = np.zeros((y.shape[1],2))
  for k in range(y.shape[1]):
    result[k, 0] = np.median(dv[ y[:, k] == 0, k ])
    result[k, 1] = np.median(dv[ y[:, k] == 1, k ])
  result = pd.DataFrame(result)
  result['tot'] = y.sum(0)
  return result

  Find the median decision values for the positive and negative instances
  of each class.
  This function is used for exploratory data analysis/model evaluation.
  
  Params:
    y - the 0-1 label matrix; a numpy array
    dv - array of decision values returned from a model; a numpy array

  Returns:
    a pandas data frame of size (# classes) x 3 with the median
    decision value on negative instances for class k in position [k, 0],
    the median positive decision value in [k, 1], and the count 
    of class k positives in [k, 2]
  
Find the median decision values for the positive and negative instances
of each class.
This function is used for exploratory data analysis/model evaluation.

the 0-1 label matrix; a numpy array
dv - array of decision values returned from a model; a numpy array

a pandas data frame of size (# classes) x 3 with the median
decision value on negative instances for class k in position [k, 0],
the median positive decision value in [k, 1], and the count
of class k positives in [k, 2]
Find the median decision values for the positive and negative instances of each class . This function is used for exploratory data analysis / model evaluation . the 0 - 1 label matrix ; a numpy array dv - array of decision values returned from a model ; a numpy array a pandas data frame of size ( # classes ) x 3 with the median decision value on negative instances for class k in position [ k 0 ] the median positive decision value in [ k 1 ] and the count of class k positives in [ k 2 ]
def dvByLabel(y, dv):
  dv = as_float_array(dv)
  result = np.zeros((y.shape[1],2))
  for k in range(y.shape[1]):
    result[k, 0] = np.median(dv[ y[:, k] == 0, k ])
    result[k, 1] = np.median(dv[ y[:, k] == 1, k ])
  result = pd.DataFrame(result)
  result['tot'] = y.sum(0)
  return result
def dvByLabel ( y , dv ) : dv = as_float_array ( dv ) result = np . zeros ( ( y . shape [ 1 ] , 2 ) ) for k in range ( y . shape [ 1 ] ) : result [ k , 0 ] = np . median ( dv [ y [ : , k ] == 0 , k ] ) result [ k , 1 ] = np . median ( dv [ y [ : , k ] == 1 , k ] ) result = pd . DataFrame ( result ) result [ 'tot' ] = y . sum ( 0 ) return result
Find the median decision values for the positive and negative instances
of each class.
Find the median decision values for the positive and negative instances of each class .
"""
  Find the median decision values for the positive and negative instances
  of each class.
  This function is used for exploratory data analysis/model evaluation.
  
  Params:
    y - the 0-1 label matrix; a numpy array
    dv - array of decision values returned from a model; a numpy array

  Returns:
    a pandas data frame of size (# classes) x 3 with the median
    decision value on negative instances for class k in position [k, 0],
    the median positive decision value in [k, 1], and the count 
    of class k positives in [k, 2]
  """
y
dv