GapAnalysis.py
def generate_sample(self, X, rgen):
        """Generate random sample for clustering."""
        sample_X = np.zeros(X.shape)
        for j in range(X.shape[1]):
            min_j = np.min(X[:,j])
            max_j = np.max(X[:,j])
            sample_X[:,j] = rgen.uniform(min_j, max_j, size=X.shape[0])
        return sample_X
Generate random sample for clustering.
Generate random sample for clustering.
Generate random sample for clustering .
def generate_sample(self, X, rgen):
        sample_X = np.zeros(X.shape)
        for j in range(X.shape[1]):
            min_j = np.min(X[:,j])
            max_j = np.max(X[:,j])
            sample_X[:,j] = rgen.uniform(min_j, max_j, size=X.shape[0])
        return sample_X
def generate_sample ( self , X , rgen ) : sample_X = np . zeros ( X . shape ) for j in range ( X . shape [ 1 ] ) : min_j = np . min ( X [ : , j ] ) max_j = np . max ( X [ : , j ] ) sample_X [ : , j ] = rgen . uniform ( min_j , max_j , size = X . shape [ 0 ] ) return sample_X
Generate random sample for clustering.
Generate random sample for clustering .
"""Generate random sample for clustering."""
self
X
rgen