-
-
Save sanchezg/8410b751ba03770ea09b3fc1a0373623 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class DirectTransformer: | |
"""Utility for building class-like features from a single-point function, but that may need | |
some general configuration first (you usually override __init__ for that) | |
""" | |
def fit(self, X, y=None): | |
return self | |
def transform(self, X): | |
return np.array([self.transform_one(x) for x in X]).reshape((-1, 1)) | |
def transform_one(self, x): | |
raise NotImplementedError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment