def make_friedman2(n_samples=100, noise=0.0, random_state=None):
 generator = check_random_state(random_state)
 X = generator.rand(n_samples, 4)
 X[:, 0] *= 100
 X[:, 1] *= (520 * np.pi)
 X[:, 1] += (40 * np.pi)
 X[:, 3] *= 10
 X[:, 3] += 1
 y = ((((X[:, 0] ** 2) + (((X[:, 1] * X[:, 2]) - (1 / (X[:, 1] * X[:, 3]))) ** 2)) ** 0.5) + (noise * generator.randn(n_samples)))
 return (X, y)

def make_friedman2 ( n_samples = 100 , noise = 0.0 , random_state = None ) : generator = check_random_state ( random_state ) X = generator . rand ( n_samples , 4 ) X [ : , 0 ] *= 100 X [ : , 1 ] *= ( 520 * np . pi ) X [ : , 1 ] += ( 40 * np . pi ) X [ : , 3 ] *= 10 X [ : , 3 ] += 1 y = ( ( ( ( X [ : , 0 ] ** 2 ) + ( ( ( X [ : , 1 ] * X [ : , 2 ] ) - ( 1 / ( X [ : , 1 ] * X [ : , 3 ] ) ) ) ** 2 ) ) ** 0.5 ) + ( noise * generator . randn ( n_samples ) ) ) return ( X , y )
generate the "friedman #2" regression problem this dataset is described in friedman [1] and breiman [2] .