stackboost/utils/data_operation.py
def calculate_variance(X):
    """ Return the variance of the features in dataset X """
    # mean = np.ones(np.shape(X)) * X.mean(0)
    # n_samples = np.shape(X)[0]
    # variance = (1 / n_samples) * np.diag((X - mean).T.dot(X - mean))
    # return variance
    var = np.sum((X - X.mean()) ** 2) / len(X)
    return var
 Return the variance of the features in dataset X 
Return the variance of the features in dataset X
Return the variance of the features in dataset X
def calculate_variance(X):
    var = np.sum((X - X.mean()) ** 2) / len(X)
    return var
def calculate_variance ( X ) : var = np . sum ( ( X - X . mean ( ) ) ** 2 ) / len ( X ) return var
Return the variance of the features in dataset X
Return the variance of the features in dataset X
""" Return the variance of the features in dataset X """ # mean = np.ones(np.shape(X)) * X.mean(0) # n_samples = np.shape(X)[0] # variance = (1 / n_samples) * np.diag((X - mean).T.dot(X - mean)) # return variance
X