Content-Length: 196853 | pFad | http://github.com/MLBazaar/MLBlocks/issues/137

0A MLPipeline does not preserve metadata from JSON pipeline annotation · Issue #137 · MLBazaar/MLBlocks · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLPipeline does not preserve metadata from JSON pipeline annotation #137

Open
micahjsmith opened this issue Jun 24, 2021 · 0 comments
Open

Comments

@micahjsmith
Copy link

  • MLBlocks version: 0.4
  • Python version: 3.8

Description

I'm trying to get metadata from an MLPipeline object that was present in the JSON pipeline annotation that was loaded. For example, the annotation has a metadata.name field that I'd like to access from the pipeline.

What I Did

In the following example, I would expect that the MLPipeline has a metadata dict which has name key, just like the JSON. But it doesn't.

$ mkdir -p mlprimitives mlpipelines
$ curl -s https://raw.githubusercontent.com/MLBazaar/MLPrimitives/master/mlprimitives/primitives/sklearn.ensemble.RandomForestRegressor.json -o mlprimitives/sklearn.ensemble.RandomForestRegressor.json
$ curl -s https://raw.githubusercontent.com/MLBazaar/MLPrimitives/master/mlprimitives/pipelines/sklearn.ensemble.RandomForestRegressor.json -o mlpipelines/sklearn.ensemble.RandomForestRegressor.json
$ jq .metadata.name mlpipelines/sklearn.ensemble.RandomForestRegressor.json 
"sklearn.ensemble.RandomForestRegressor"
$ python
Python 3.8.3 (default, Jul 20 2020, 16:43:14) 
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from mlblocks import load_pipeline, MLPipeline
>>> pipeline = MLPipeline(load_pipeline('sklearn.ensemble.RandomForestRegressor'))
>>> pipeline.metadata
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'MLPipeline' object has no attribute 'metadata'

Suggestions

  1. Explicitly support persisting metadata on the MLPipeline object (and presumably on underlying MLBlock objects)
  2. Raise an error of the JSON input contains unused (unsupported) keys
  3. Guarantee that MLPipeline.load and MLPipeline.save are inverse operations, i.e. that no data is lost (currently metadata fields are lost)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/MLBazaar/MLBlocks/issues/137

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy