models.py
def predict(self, x):
    '''
    Prediction method predicts class membership of instances with decision 
    values above threshold t1 or within t2 of the highest decision value 
    on that instance.
    
    Params:
      x - input features, not used
      y - 0-1 label matrix, not used
  
    Returns:
      A 0-1 matrix of predicted labels of size (# instances) x (# classes).
    '''
    dvs = self.decision_function(x)
    pred = (dvs > self.t1).astype(float)
    max_dv = dvs.max(1)
    for k in range(pred.shape[0]):
      cut = max_dv[k] - self.t2
      idx = (dvs[k, :] >= cut) 
      pred[k, idx] = 1
    return pred

    Prediction method predicts class membership of instances with decision 
    values above threshold t1 or within t2 of the highest decision value 
    on that instance.
    
    Params:
      x - input features, not used
      y - 0-1 label matrix, not used
  
    Returns:
      A 0-1 matrix of predicted labels of size (# instances) x (# classes).
    
Prediction method predicts class membership of instances with decision
values above threshold t1 or within t2 of the highest decision value
on that instance.

input features, not used
y - 0-1 label matrix, not used

A 0-1 matrix of predicted labels of size (# instances) x (# classes).
Prediction method predicts class membership of instances with decision values above threshold t1 or within t2 of the highest decision value on that instance . input features not used y - 0 - 1 label matrix not used A 0 - 1 matrix of predicted labels of size ( # instances ) x ( # classes ) .
def predict(self, x):
    dvs = self.decision_function(x)
    pred = (dvs > self.t1).astype(float)
    max_dv = dvs.max(1)
    for k in range(pred.shape[0]):
      cut = max_dv[k] - self.t2
      idx = (dvs[k, :] >= cut) 
      pred[k, idx] = 1
    return pred
def predict ( self , x ) : dvs = self . decision_function ( x ) pred = ( dvs > self . t1 ) . astype ( float ) max_dv = dvs . max ( 1 ) for k in range ( pred . shape [ 0 ] ) : cut = max_dv [ k ] - self . t2 idx = ( dvs [ k , : ] >= cut ) pred [ k , idx ] = 1 return pred
Prediction method predicts class membership of instances with decision
values above threshold t1 or within t2 of the highest decision value
on that instance.
Prediction method predicts class membership of instances with decision values above threshold t1 or within t2 of the highest decision value on that instance .
'''
    Prediction method predicts class membership of instances with decision 
    values above threshold t1 or within t2 of the highest decision value 
    on that instance.
    
    Params:
      x - input features, not used
      y - 0-1 label matrix, not used
  
    Returns:
      A 0-1 matrix of predicted labels of size (# instances) x (# classes).
    '''
self
x