This tutorial has shown how you can wrap the execution of any SPSS Modeler predictive analytic (that is compatible with the Solution Publisher API restrictions and makes sense to execute a tuple at a time). It has also provided insight as to how the sample operator provided could be adjusted to handle different models.
Note that there are other ways to execute scoring models in InfoSphere Streams through PMML and the Streams Mining toolkit. The direct wrapping technique and integration with SPSS models through the Solution Publisher interface provided here opens the scoring up to a much larger set of models than what are supported through the PMML integrations of the Mining Toolkit.
Possibilities for extending this work:
- Producing a generic operator with mapping code driven off parameters and the XML metadata allowing for models to be incorporated without the need to modify the operator C++ template code (see Part 2 of this series).
- Providing customizable error behavior when execution fails or data is malformed.
- Providing better support for dynamically updating the model. You could just stop and restart the operator, causing it to reload the .pim and .par files, but something akin to the way the modeling toolkit has an optional input port to feed new models and have the operator manage the replacement of the model.