Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi,
I am looking for ways to automate the pmml export to Teradata Database table by creating a plugin. Is there a way I could see the pmml exporting python code and replicate that in python recipe to automate it?
Can I convert the "dataiku.core.saved_model.Model" to "pmml"? If yes, please help me with that.
Hello,
You can convert a dss saved model to pmml with the dss python api method get_scoring_pmml_stream.
Here is a code sample to do so from a notebook.
I hope it helps,
Arnaud
import dataiku
client = dataiku.api_client()
pmml_model_as_string = client.get_project('PROJECT_KEY').get_saved_model('SAVED_MODEL_ID').get_version_details('initial').get_scoring_pmml_stream().content
Thank you so much @arnaudde, that was an awesome solution!
is there a way to insert the extracted pmml into a database table with the existing database connection?
The shape of the pmml models will vary significantly so I think it makes more sense to store the pmml files as xml files in a managed folder.
Hope it helps,
Arnaud
Hi,
I understand that but my main goal is to push the pmml to the database table directly without downloading and importing into database. In Teradata Database I can score the models within the database if I can push the pmml into a table. Anyway, help with this, how can I insert data/objects into database table from python recipe.
I have attached a screenshot of how I am trying to insert it. Please give your input on this.
Thanks,
Kumar
Hello,
Your format statement does not do anything:
sql_statement.format(table_name="...")
You should use brackets, like explained here.