def transform(self, X):
    df = X.copy()
    keep = [column for column in df.columns if (df[column].value_counts(normalize=True).reset_index(drop=True)[0] < self.threshold)]
    return df[keep]
def transform(self, X):
    df = X.copy()
    keep = [column for column in df.columns if (df[column].value_counts(normalize=True).reset_index(drop=True)[0] < self.threshold)]
    return df[keep]