Search

Automated Retraining

Business Problem

Machine learning trains a model with data fed to it at a given moment in time. Data, however, can be constantly changing. Business dynamics change, economies change, and having an up-to-date stream of data to retrain your models with will keep them from becoming stale, ensuring that their prediction accuracy does not weaken over time.

An automated retraining of the machine learning model would keep the model fresh, trained on the most recent data, and not require a manual process to swap out new models for old.


Components

Requirements

  • Access to an Infor CloudSuite
  • Infor AI Security Roles:
    • COLEMANAI-User
    • COLEMANAI-Administrator
  • User privileges to ION workflow
  • An AI quest that:
    • Draws data from datalake
    • Runs successfully
    • Has a deployed Endpoint
  • A dataflow that updates the data in the datalake

Tutorial

In this tutorial, we will create a workflow in ION that will periodically run an automatic model update for the desired Infor AI model. Before we get started with the actual workflow, we will need to download the service account credentials

In order for ION Workflow to later call the Infor AI API a service account must be created.

1. Service Account Credentials Download

  • Navigate to the security section of Infor OS. Use the menu on the left (hamburger menu) and go to Manage > Service Accounts
  • Click the + for Add new item
  • Add your username to the username field
  • Save the Service Account Credentials locally with the save icon. It will download a CSV file named “Service Account” that includes the tenant name and a unique identifier.

2. Navigate to ION

Automated retraining will actually take place in Infor ION. Navigate to ION in Infor OS and using the side menu select Monitors & Workflows > Workflows.

  1. Create a new workflow

Use the interface to create a new workflow by clicking +Add. Certainly, you could add these steps to larger existing workflows, but we are going to model this in a new workflow that will just be focused on the retraining.

  1. Add AI Task

Drag the AI task from the pool of available workflow activities to the workflow.

  1. Settings

Click on the AI block to access its properties. In the AI task dropdown, select “Reload Datasets” for the first activity. Identify the quest name and import the service account file we created in step one. The quest name serves as the identifier for all activities, so even if you are reloading data sets select the quest that those datasets are called from. Rename the activity as appropriate.

  1. Test Configuration

Move to the “Test” hub and click the test button. This should tell you if the AI task, quest name, and service account are valid and agree with each other.

  1. Error Handling

In the settings tab, specify how you want errors handled. You can optionally select to continue the workflow and send error messages, however, it makes more sense in the retraining case to select “The Workflow Fails”, as it doesn’t make sense to continue with retraining activities if the data has failed to update.

  1. Repeat for each of the four retraining activities.

There are four options available in a AI task that appear in the dropdown. Executing these tasks in succession will complete a retraining cycle. Create one activity for each of the available tasks in this order:

  • Reload Datasets
  • Retrain Model
  • Update Production Quest
  • Redeploy endpoint

Once completed, your workflow should look something like this, and the error/notification bubbles should all be resolved. Be sure to save the workflow.

  1. Schedule retraining

Back in the left-hand ION navigation menu, under Monitors & Workflows, navigate to Workflow Schedules. Create a new workflow schedule with the “+Add” button and give it a name and description. Use the schedule panel to detail when you would like the workflow to run, and at what frequency. In the action panel, find the workflow you created above and select it in the dropdown. In the “Trigger Workflow Instance” dropdown, select skip if workflow is running.

Retraining frequency should be scheduled to account for frequency of variations in data that we expect to affect the model predictions. For instance, daily or weekly retraining on data updated on a daily or weekly basis will likely not produce measurable model changes. Retraining on a monthly, seasonally, or even yearly basis will give the data a chance to have a significant effect on the model.

  1. Activate

Using the toolbar at the top, save the workflow schedule and click activate. Your workflow is now configured for automated retraining and will trigger at the specified time. To verify that retraining occurred, examine the quest in Infor AI. There will be two locations that tell you the quest was triggered from ION Workflows, the quest tile on the quest home screen, and the status messages on the left-hand side of the quest when you open it.