gramex icon indicating copy to clipboard operation
gramex copied to clipboard

GRAMEX-196 ⁃ `build_transform` cannot compile sklearn estimator methods

Open jaidevd opened this issue 3 years ago • 2 comments

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

jaidevd avatar May 27 '22 06:05 jaidevd

This particular problem notwithstanding, arbitrary transformations in MLHandler should be exposed through FunctionTransformer, not build_transform.

jaidevd avatar May 27 '22 15:05 jaidevd

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

jaidevd avatar May 27 '22 16:05 jaidevd