def make_s_curve(n_samples=100, noise=0.0, random_state=None):
 generator = check_random_state(random_state)
 t = ((3 * np.pi) * (generator.rand(1, n_samples) - 0.5))
 x = np.sin(t)
 y = (2.0 * generator.rand(1, n_samples))
 z = (np.sign(t) * (np.cos(t) - 1))
 X = np.concatenate((x, y, z))
 X += (noise * generator.randn(3, n_samples))
 X = X.T
 t = np.squeeze(t)
 return (X, t)

def make_s_curve ( n_samples = 100 , noise = 0.0 , random_state = None ) : generator = check_random_state ( random_state ) t = ( ( 3 * np . pi ) * ( generator . rand ( 1 , n_samples ) - 0.5 ) ) x = np . sin ( t ) y = ( 2.0 * generator . rand ( 1 , n_samples ) ) z = ( np . sign ( t ) * ( np . cos ( t ) - 1 ) ) X = np . concatenate ( ( x , y , z ) ) X += ( noise * generator . randn ( 3 , n_samples ) ) X = X . T t = np . squeeze ( t ) return ( X , t )
generate an s curve dataset .