Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi DSS community,
I am trying to create an optimization (not an ML model using sklearn and other libraries) plugin for a specific project. The model I created has .fit() and .predict() functions.
When training the model, I used the .fit() function. How can I use this saved model later with its .predict() function, in the same plugin ?
1) Training my model using a first python recipe recipe.py:
2) Use it with a second recipe using the same plugin in the prediction_recipe.py:
Thanks in advance
I'd recommend having two "recipe" components as part of your plugin - one for training, one for scoring.
Here's an example of how the deep learning image plugin has separate train/score recipes:
The train recipe has your train dataset as an input, and it outputs a serialized model object (saved as ONNX, h5, pickle, etc.) saved to a managed folder. The score recipe then takes the model folder and your dataset-to-be-scored as inputs, and outputs predictions to a dataset.
(Note that the deep learning image plugin is now deprecated in favor of deep learning integrated in the regular visual ML interface - but this is still a good example of how you can structure it)
Here's the github repo for this plugin: https://github.com/dataiku/dss-plugin-deeplearning-image/tree/master/custom-recipes
In each of the sub-folders here^, there's a separate recipe (for train, score, etc.).