hi, is there some python example on how can I pass...
# troubleshoot
b
hi, is there some python example on how can I pass the trainingData and evaluationData to Aspects in MLModelSnapshot? what I tried was to pass it like:
Copy code
TrainingDataClass(
                    trainingData=training_data
                )
But it doesn't work, my training_data is just a list with dictionaries containing the key, value pairs like in this example below: https://github.com/datahub-project/datahub/blob/a121aff6eb2814dc6d15c4406793ad1bd9[…]5eed3e/metadata-ingestion/examples/mce_files/bootstrap_mce.json
h
Hey, trainingData and EvaluationData is not a key-value pair but an array of BaseData having keys dataset, motivation and preProcessing.
This page from datahub docs site - https://datahubproject.io/docs/generated/metamodel/entities/mlmodel also describe json schema for these.
b
@hundreds-photographer-13496 thanks for reply so.. if I will pass this:
Copy code
test = [
            {
                "urn": "urn:li:dataset:(urn:li:dataPlatform:s3,my/testing/stuff/file.parquet,TEST)",
                "motivation": "For science!",
                "preprocessing": ["Aggregation"]
            }
        ]
to:
Copy code
TrainingDataClass(
                    trainingData=test
                ),
then this should work, right? Or does it require additional creation of some object?
h
I think you'll need to use BaseData class:
Copy code
test = [
            BaseData(
                urn= "urn:li:dataset:(urn:li:dataPlatform:s3,my/testing/stuff/file.parquet,TEST)",
                motivation= "For science!",
                preprocessing= ["Aggregation"]
            )
        ]
b
@hundreds-photographer-13496 yes thanks, that did the trick! Although instead of urn, dataset should be passed as a param name 🙂 Thanks for help
@hundreds-photographer-13496 one last thing, so assuming that this would work, where should I see datasets correlated to my MlModel?
h
Hmm, well, it gets saved in the model and can be queried back using CLI . I am not sure where/whether is shows up on UI. Can you check in #ui channel about it ?
b
sure thing! thanks