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)