This is a template for IntegratedML - InterSystems Github repository.
This repository comes with a few example Jupyter notebooks (http://jupyter.org) which demonstrate how to use IntegratedML in InterSystems IRIS Community Edition (Advanced Analytics including IntegratedML) in a docker container.
- What is IntegratedML?
- What's inside this template
- Pre-configured environment, and sample data
- How to develop your IntegragedML solution with the IntegratedML Template Repo
- How to Import data into InterSystems IRIS
IntegratedML is a feature of the InterSystems IRIS data platform that brings machine learning to SQL developers.
IntegratedML is
- all-SQL -- Build and train machine learning models using intuitive custom SQL commands, fully integrated within the InterSystems IRIS SQL processor
- turnkey -- no packages or programming languages to learn, nothing to install
- modular -- leverages "best of breed" open source and proprietary AutoML frameworks
Learn more about InterSystems IRIS and IntegratedML at the InterSystems Learning site
This template creates a docker environment (via "docker-compose up") of 2 pre-configured containers:
- tf2jupyter: Jupyter+Tensorflow2.2(without GPU), with a few sample notebook files (in its Dockerfile)
- irisimlsvr another one for an IRIS 2020.3 Community Edition, with pre-loaded sample data in USER namespace(see its Dockerfile and iris.script that is run at startup)
4 sample notebook files -- by default this template starts Jupyter at http://localhost:8896/tree :
- campaign-integratedml-jdbc.ipynb: A simple JDBC connection from tf2jupyter into a sample data table (Marketing Campaign data) within InterSystems IRIS's USER namespace, showing some use of IntegratedML including VALIDATE MODEL command usage.
- readmission-integratedml-jdbc.ipynb: Demonstrates use of IntegratedML on a hospital readmission prediction dataset.
- biomedical-integratedml-PyODBC.ipynb: Connection to InterSystems IRIS server over PyODBC, building and using an IntegratedML machine learning model, with a complex SQL query using the PREDICT() and PROBABILITY() IntegratedML SQL functions.
- ED_visit_90_day.ipynb: Building and using an IntegratedML machine learning model to predict visits to Emergency Department, utilizing data from a Health Insight server, kindly provided by Joseph Cofone at Baystate Health.
Make sure you have git and Docker desktop installed.
This template is tested breifly on AWS Ubuntu, Mac OS, and Windows 10(using Docker Toolbox only). It should work on other Docker environment too - let us know if you encounter any issues.
Clone/git pull the repo into any local directory
$ git clone https://github.com/intersystems-community/integratedml-demo-template.git
Open a Docker terminal in this directory and run:
$ docker-compose build
- Run the IRIS container, and Jupyter notebook server images:
$ docker-compose up -d
- Open browser to access the notebooks
http://localhost:8896/tree
Note: use docker-compose ps
to confirm tf2juyter's ports; make sure right localhost port is used if over SSL tunneling to remotehost)
- Examine the test data with webterminal Open terminal with: SuperUser / SYS credentials
http://localhost:8092/terminal/
Enter /sql mode and make SQL queries to examine data in IRIS.
Click the button "Use this template" on Github to create a new repository which will be the copy of this one.
Clone your new repo to a local folder.
Install VSCode, Docker Desctop and ObjectScript plugin and open the folder in VSCode.
Import your data as listed below, rebuild containers to let the data be imported, and use IntegratedML via SQL tools, as described in Jupyter notebooks.
- Add csv file into the repository, e.g. like this titanic.csv
- Introduce an import data call into your IRIS initalisation script. This is an example line to import titanic.csv into IRIS User.Passengers class along with data.
- Query the data from any SQL tool, web terminal or from InterSystems ObjectScript with:
SELECT * From Passengers
If your file is accessible remotely, you can import it as follows:
- Add the import CSV from URL line into iris.script. Here is an example line to import countries.csv data from URL
- Rebuild the docker image (the easiest way is to rebuild via docker-compose --
docker-compose build
). This will create User.Countries class and import data which you can query with SQL from Countries table:
SELECT * FROM COUNTRIES