models.py
def cvdv(model, x, y, k=3, use_predict=False):
  """
  Get dvs for all of x by training on k folds, predicting on 1,
  and aggregating the predictions into an object the same shape as y.
  
  Params:
    x - input features
    y - 0-1 label matrix
    k - # of cross-validation folds
    use_predict - If true, use predict() instead of decision_value()
        to get the return values. Default False. 
  
  Returns:
    a real matrix of predictions made within cross-validation
  """
  folds = KFold(y.shape[0], k)
  dv = 0*y
  for train, val in folds:
    model.fit(x[train], y[train])
    if use_predict:
      dv[val] = model.predict(x[val])
    else:
      dv[val] = model.decision_function(x[val])
  return dv

  Get dvs for all of x by training on k folds, predicting on 1,
  and aggregating the predictions into an object the same shape as y.
  
  Params:
    x - input features
    y - 0-1 label matrix
    k - # of cross-validation folds
    use_predict - If true, use predict() instead of decision_value()
        to get the return values. Default False. 
  
  Returns:
    a real matrix of predictions made within cross-validation
  
Get dvs for all of x by training on k folds, predicting on 1,
and aggregating the predictions into an object the same shape as y.



a real matrix of predictions made within cross-validation
Get dvs for all of x by training on k folds predicting on 1 and aggregating the predictions into an object the same shape as y . a real matrix of predictions made within cross - validation
def cvdv(model, x, y, k=3, use_predict=False):
  folds = KFold(y.shape[0], k)
  dv = 0*y
  for train, val in folds:
    model.fit(x[train], y[train])
    if use_predict:
      dv[val] = model.predict(x[val])
    else:
      dv[val] = model.decision_function(x[val])
  return dv
def cvdv ( model , x , y , k = 3 , use_predict = False ) : folds = KFold ( y . shape [ 0 ] , k ) dv = 0 * y for train , val in folds : model . fit ( x [ train ] , y [ train ] ) if use_predict : dv [ val ] = model . predict ( x [ val ] ) else : dv [ val ] = model . decision_function ( x [ val ] ) return dv
Get dvs for all of x by training on k folds, predicting on 1,
and aggregating the predictions into an object the same shape as y.
Get dvs for all of x by training on k folds predicting on 1 and aggregating the predictions into an object the same shape as y .
"""
  Get dvs for all of x by training on k folds, predicting on 1,
  and aggregating the predictions into an object the same shape as y.
  
  Params:
    x - input features
    y - 0-1 label matrix
    k - # of cross-validation folds
    use_predict - If true, use predict() instead of decision_value()
        to get the return values. Default False. 
  
  Returns:
    a real matrix of predictions made within cross-validation
  """
model
x
y
k
use_predict