def make_hastie_10_2(n_samples=12000, random_state=None):
 rs = check_random_state(random_state)
 shape = (n_samples, 10)
 X = rs.normal(size=shape).reshape(shape)
 y = ((X ** 2.0).sum(axis=1) > 9.34).astype(np.float64)
 y[(y == 0.0)] = (-1.0)
 return (X, y)

def make_hastie_10_2 ( n_samples = 12000 , random_state = None ) : rs = check_random_state ( random_state ) shape = ( n_samples , 10 ) X = rs . normal ( size = shape ) . reshape ( shape ) y = ( ( X ** 2.0 ) . sum ( axis = 1 ) > 9.34 ) . astype ( np . float64 ) y [ ( y == 0.0 ) ] = ( - 1.0 ) return ( X , y )
generates data for binary classification used in hastie et al .