def _partial_fit_ovo_binary(estimator, X, y, i, j):
 cond = np.logical_or((y == i), (y == j))
 y = y[cond]
 y_binary = np.zeros_like(y)
 y_binary[(y == j)] = 1
 return _partial_fit_binary(estimator, X[cond], y_binary)

def _partial_fit_ovo_binary ( estimator , X , y , i , j ) : cond = np . logical_or ( ( y == i ) , ( y == j ) ) y = y [ cond ] y_binary = np . zeros_like ( y ) y_binary [ ( y == j ) ] = 1 return _partial_fit_binary ( estimator , X [ cond ] , y_binary )
partially fit a single binary estimator .