def transform(self, dataframe):
    for param_dict in self.param_dict:
        (key, var, agg, on) = self._get_params(param_dict)
        for a in agg:
            for v in var:
                new_feature = '_'.join((['ratio', a, v, 'groupby'] + key))
                base_feature = '_'.join(([a, v, 'groupby'] + key))
                dataframe[new_feature] = (dataframe[v] / dataframe[base_feature])
    return dataframe
def transform(self, dataframe):
    for param_dict in self.param_dict:
        (key, var, agg, on) = self._get_params(param_dict)
        for a in agg:
            for v in var:
                new_feature = '_'.join((['ratio', a, v, 'groupby'] + key))
                base_feature = '_'.join(([a, v, 'groupby'] + key))
                dataframe[new_feature] = (dataframe[v] / dataframe[base_feature])
    return dataframe