@@ -112,13 +112,14 @@ def make_classification(n_samples=100, n_features=20, n_informative=2,
112112 # Count features, clusters and samples
113113 if n_informative + n_redundant + n_repeated > n_features :
114114 raise ValueError ("Number of informative, redundant and repeated "
115- "features must sum to less than the number of total features" )
115+ "features must sum to less than the number of total"
116+ " features" )
116117 if 2 ** n_informative < n_classes * n_clusters_per_class :
117118 raise ValueError ("n_classes * n_clusters_per_class must"
118- "be smaller or equal 2 ** n_informative" )
119+ "be smaller or equal 2 ** n_informative" )
119120 if weights and len (weights ) not in [n_classes , n_classes - 1 ]:
120121 raise ValueError ("Weights specified but incompatible with number "
121- "of classes." )
122+ "of classes." )
122123
123124 n_useless = n_features - n_informative - n_redundant - n_repeated
124125 n_clusters = n_classes * n_clusters_per_class
@@ -186,7 +187,7 @@ def make_classification(n_samples=100, n_features=20, n_informative=2,
186187 if n_redundant > 0 :
187188 B = 2 * generator .rand (n_informative , n_redundant ) - 1
188189 X [:, n_informative :n_informative + n_redundant ] = \
189- np .dot (X [:, :n_informative ], B )
190+ np .dot (X [:, :n_informative ], B )
190191
191192 # Repeat some features
192193 if n_repeated > 0 :
@@ -485,7 +486,7 @@ def make_regression(n_samples=100, n_features=100, n_informative=10,
485486
486487
487488def make_circles (n_samples = 100 , shuffle = True , noise = None , random_state = None ,
488- factor = .8 ):
489+ factor = .8 ):
489490 """Make a large circle containing a smaller circle in 2d.
490491
491492 A simple toy dataset to visualize clustering and classification
@@ -526,8 +527,8 @@ def make_circles(n_samples=100, shuffle=True, noise=None, random_state=None,
526527 inner_circ_x = outer_circ_x * factor
527528 inner_circ_y = outer_circ_y * factor
528529
529- X = np .vstack ((np .append (outer_circ_x , inner_circ_x ),\
530- np .append (outer_circ_y , inner_circ_y ))).T
530+ X = np .vstack ((np .append (outer_circ_x , inner_circ_x ),
531+ np .append (outer_circ_y , inner_circ_y ))).T
531532 y = np .hstack ([np .zeros (n_samples / 2 ), np .ones (n_samples / 2 )])
532533 if shuffle :
533534 X , y = util_shuffle (X , y , random_state = generator )
@@ -574,8 +575,8 @@ def make_moons(n_samples=100, shuffle=True, noise=None, random_state=None):
574575 inner_circ_x = 1 - np .cos (np .linspace (0 , np .pi , n_samples_in ))
575576 inner_circ_y = 1 - np .sin (np .linspace (0 , np .pi , n_samples_in )) - .5
576577
577- X = np .vstack ((np .append (outer_circ_x , inner_circ_x ),\
578- np .append (outer_circ_y , inner_circ_y ))).T
578+ X = np .vstack ((np .append (outer_circ_x , inner_circ_x ),
579+ np .append (outer_circ_y , inner_circ_y ))).T
579580 y = np .hstack ([np .zeros (n_samples_in ), np .ones (n_samples_out )])
580581
581582 if shuffle :
@@ -793,7 +794,7 @@ def make_friedman2(n_samples=100, noise=0.0, random_state=None):
793794 X [:, 3 ] += 1
794795
795796 y = (X [:, 0 ] ** 2
796- + (X [:, 1 ] * X [:, 2 ] - 1 / (X [:, 1 ] * X [:, 3 ])) ** 2 ) ** 0.5 \
797+ + (X [:, 1 ] * X [:, 2 ] - 1 / (X [:, 1 ] * X [:, 3 ])) ** 2 ) ** 0.5 \
797798 + noise * generator .randn (n_samples )
798799
799800 return X , y
@@ -924,8 +925,8 @@ def make_low_rank_matrix(n_samples=100, n_features=100, effective_rank=10,
924925 singular_ind = np .arange (n , dtype = np .float64 )
925926
926927 # Build the singular profile by assembling signal and noise components
927- low_rank = (1 - tail_strength ) * \
928- np .exp (- 1.0 * (singular_ind / effective_rank ) ** 2 )
928+ low_rank = (( 1 - tail_strength ) *
929+ np .exp (- 1.0 * (singular_ind / effective_rank ) ** 2 ) )
929930 tail = tail_strength * np .exp (- 0.1 * singular_ind / effective_rank )
930931 s = np .identity (n ) * (low_rank + tail )
931932
@@ -1105,7 +1106,7 @@ def make_sparse_spd_matrix(dim=1, alpha=0.95, norm_diag=False,
11051106 aux [aux < alpha ] = 0
11061107 aux [aux > alpha ] = (smallest_coef
11071108 + (largest_coef - smallest_coef )
1108- * random_state .rand (np .sum (aux > alpha )))
1109+ * random_state .rand (np .sum (aux > alpha )))
11091110 aux = np .tril (aux , k = - 1 )
11101111
11111112 # Permute the lines: we don't want to have assymetries in the final
0 commit comments