class ColumnExtractor(object):

    def transform(self, X):
        cols = X[:, 2:4]
return cols

def fit(self, X, y=None):
    return self
How can I use a custom feature selection function in scikit-learn's `pipeline`