Connect Altair IoT Studio with Altair AI Hub

This tutorial will guide you through the process of learning how to access the data stored in IoT Studio to develop models and Machine Learning (ML) processes in Altair® AI Hub™, and how to deploy the ML or Artificial Intelligence (AI) workflows to be accessible from IoT Studio to execute them in real-time.

In this tutorial, you will:
  • Access the data stored in IoT Studio from AI Hub to create models and ML processes
  • Build a REST API deployment to make the model created in AI Hub accessible to clients over the internet
  • Build a function in IoT Studio and define the logic to execute the model accessible through a REST API
Note: In this tutorial, a simple workflow to get the data will be defined. To learn more about developing models and ML processes, access AI Hub documentation here.

Click below to watch the tutorial.

Additional information

Listed below you will find additional documentation about the features covered in the tutorial:

An example of the Python code for the function to access the AI Hub deployment through REST API is provided:

import requests

def handle(req):

    url = '<enter-your-deployment-url>'
    headers = {
        'Authorization': 'enter-your-security-token',
        'Content-Type': 'application/json'
    }

    # The variable data will store the inputs required to execute your model correctly
    data = {

    }

    response = requests.post(url, headers=headers, json=data)

    print(response.text)

    return {
        "status_code": 200,
        "body": req.body.decode('utf-8')
    }
Note: You could improve the logic defined in the Function, for example, to get the data in real-time from any asset connected to the IoT platform and store the prediction result from executing the AI Hub deployment in IoT Studio, while triggering an action based on the result.