gramex
gramex copied to clipboard
GRAMEX-196 ⁃ `build_transform` cannot compile sklearn estimator methods
In MLHandler, we use transforms to preprocess data. But they don't work in some cases, like:
handler: MLHandler
kwargs:
data:
url: ...
transform: sklearn.preprocessing.PolynomialFeatures(2).fit_transform
This results in the built transform being None.
┆Issue is synchronized with this Jira Bug
This particular problem notwithstanding, arbitrary transformations in MLHandler should be exposed through FunctionTransformer, not build_transform.
This also means we cannot use Gramex pipelines to create sklearn pipelines. I'd like to do the following:
kwargs:
model:
pipeline:
- sklearn.preprocessing.StandardScaler().fit_transform
- sklearn.preprocessing.PolynomialFeatures().fit_transform