ZPM package version issue fix
An IRIS Interoperability adapter to use ML models managed by IRIS IntegratedML.
The projetc's goal is to let interoperability developers use ML models capabilities in their interoperability productions. Such functionalty is achieve by IRIS Interoperability extension framework, through a custom adapter which access ML models managed by IRIS IntegratedML.
Open the production and start it (user/password for IRIS instance: SuperUser/SYS). As an example of adapter's use, a model for credit card transactions fraud detection was used to simulate a simple financial production. A service starts to receive transactions to process and when a suspicious transaction is detected, an alert is issued.
Results are also persisted in iris-shared/output/valid-transactions.txt file.
Clone/git pull the repo into any local directory
Open a Docker terminal in this directory and run:
$ docker-compose build
$ docker-compose up -d
If you just wanna the adaptor, you could install it through ZPM. Open Terminal and call:
USER>zpm "install interoperability-integratedml-adapter"
Create a host class (aBusiness Process or Business Operation class) which uses as adapter the class dc.ENS.Adapter.ClassificationMLAdapter.
After saving the class, you must to configure the model's name into parameter "Model", like this:
The adaptor loads all classification models available in the namespace, so you can choose the one which best fits to your needs.
Now, you can use adapter's method Classify(), and provide a sample of features expected by the model:
This method returns a object of the class dc.Ens.Adapter.ClassificationResult. As you can see, this class has properties for prediction and probability calculated by the classification model.
You can use them as your needs. In the example, just the result for fraud prediction was necessary, so the Business Operation class just use value returned into Predicted property:
For regression models, the results is modeled by dc.Ens.Adapter.RegressionResult class. This class has a property called Estimated.
For get a estimation value from a sample, the adapter class for regression model has the Estimate method.
In a similar way, the class dc.Ens.Adapter.RegressionMLAdapter executes a SQL but just using the PREDICT function for estimation of regression models.
Notice that the model name is referenced by Model property. Such property must be defined in host class that uses the adapter, otherwise an exception will be thown. For example:
The model list in the adaptor settings is done by two steps:
For regression models, there's the class dc.Ens.Adapter.RegressionMLContextSearch, which loads all regression models.
In this case, the MODE_TYPE filter is set to 'regression' instead of 'classfication':
In such way it's possible to interoperability developers use ML models in their workflows without care about specific SQL sintax.
Once the adapter lets interoperability users to just use ML into their work flows without caring about ML models prototyping and implementation, this adapter could help developers by:
A notebook explaing the process of analysis and model prototype development is presented at http://localhost:8896/tree.
This work was based in templates for IRIS Interoperability and IRIS intergrated ML:
Data used for examples, was adapted from public repositories avaible in Kaggle: