def _compute_centers(self, X, sparse, rs):
<EOL>centers = self._get_user_components('<STR_LIT>')<EOL>if (centers is None):<EOL><INDENT>n_features = X.shape[<NUM_LIT:1>]<EOL>if (sparse):<EOL><INDENT>fxr = range(n_features)<EOL>cols = [X.getcol(i) for i in fxr]<EOL>min_dtype = X.dtype.type(<NUM_LIT>)<EOL>sp_min = lambda col: np.minimum(min_dtype, np.min(col.data))<EOL>min_Xs = np.array(map(sp_min, cols))<EOL>max_dtype = X.dtype.type(-<NUM_LIT>)<EOL>sp_max = lambda col: np.maximum(max_dtype, np.max(col.data))<EOL>max_Xs = np.array(map(sp_max, cols))<EOL><DEDENT>else:<EOL><INDENT>min_Xs = X.min(axis=<NUM_LIT:0>)<EOL>max_Xs = X.max(axis=<NUM_LIT:0>)<EOL><DEDENT>spans = max_Xs - min_Xs<EOL>ctrs_size = (self.n_hidden, n_features)<EOL>centers = min_Xs + spans * rs.uniform(<NUM_LIT:0.0>, <NUM_LIT:1.0>, ctrs_size)<EOL><DEDENT>self.components_['<STR_LIT>'] = centers<EOL>
Generate RBF centers