Quick-start exercises: Training

These exercises are based on process, build and test data for an Additive Manufacturing part. Together, the MI Machine Learning Quick-start exercises walk through solving a build optimization problem for this part, starting with creating a trained machine learning model from sparse, noisy data, and ending with a potential set of build parameters to try.

In the exercises for the Training app, you will:

  • Construct a feature matrix from Granta MI data. 
  • Train a machine learning algorithm on that feature matrix.

Pre-requisites:

Exercise 1: Create and manage models

The Training app is where you can view, create, duplicate, edit and delete models. The models displayed here can be at any stage between a saved name and description, and a fully trained and tested machine learning model. Untrained and in-progress models can only be viewed in the Training app.

  1. In Granta MI, go to Machine Learning > Training. You can update the list of models by clicking Refresh.
  2. Create a new model.
    1. Click Create new model on the left-hand toolbar, and enter a Name. Descriptions are optional, and can be used to record metadata and filter the list.
    2. Click Save.
    3. You will be taken to the Define Matrix screen for the new model. For now, click Training in the header to return to the model list.
  3. You can also create a new model by cloning an existing one.
    1. Select your model from the list by clicking it, then click Clone model.
    2. Click Save.
    3. Return to the model list.
  4. Rename or delete a model.
    1. Right-click your cloned model, then select Rename to edit its Name and Description. Click Save.
    2. Select your cloned model, and click Delete. Click Yes to delete the cloned model.

Exercise 2: Add records and attributes to a model

In this exercise, you’ll define a feature matrix using Granta MI data, and send it to the Alchemite engine for training and testing. The trained model can be used to investigate the effects of different AM build parameters on the strength and surface roughness of a part.

  1. Edit the model you created in Exercise 1 by right-clicking on your model’s name, and selecting Edit.
  2. Choose a database and primary table. The primary table must contain all the records you want to include in your feature matrix (you can train your model on any data in the primary table records, or linked to those records). The database and primary table cannot be edited once you leave this page.
    1. Select the MI Training database from the drop-down list. You may need to click outside the Select database list before the Select primary table list appears.
    2. Set the primary table to Machine learning: Builds.
    3. Click Next or Add features.
  3. Add input features to the Feature Set. Each attribute in the Feature Set will become a column or columns in the feature matrix sent to the engine for training.
    1. In the Manage Attributes tab on the right-hand panel, click Select all.
    2. In the dialog, click Yes to add all attributes to the Feature Set.
    3. For this example, we want to exclude Border power and Volumetric energy density data from the model. Deselect the checkbox next to each attribute to remove it from the Feature Set, and click Yes in the dialog to confirm. You should now have five attributes in the Feature Set, all listed under Machine learning: Builds with a Purpose set to Input (this is the default when a new feature is added).
  4. Add a linked table with test data.
    1. Go to the Manage Links tab on the right-hand panel. This tab displays a list of tables linked to the primary table.
    2. Select the checkbox next to Machine learning: Test data to add it to your Matrix. It will appear in the link display area above the Feature Set table.
  5. Add output features from the linked table. Although in this example, all our input features are from one table and outputs from another, any attribute you add from any table can be either an input or output feature.
    1. Click Machine learning: Test data in the link display area to select it.
    2. Go to the Manage Attributes tab, click Select All, then confirm.
    3. In the Feature Set table, set the Purpose of Surface finish and Ultimate tensile strength to Output.
    4. Click Next to go to the Populate Matrix tab.
  6. Populate the record list. Each record will become a row or rows in the feature matrix sent to the engine for training.
    1. Create a Favorites list containing the records you want to add to your model.
      1. Go to MI Explore, and select the MI Training Machine Learning Build Data data view. All changes to your model are saved automatically as they are made; you can leave the Training app without losing your work.
      2. Right-click in the List tab and Select all.
      3. Right-click again and Add to Favorites list.
      4. In the dialog, click + (Create new Favorites list), then enter a Name for your list and click Save.
      5. Click Add. You can check that your new list and the selected records have saved correctly by viewing them in the Favorites app.
    2. Go back to the Training app. Find your model in the list and double-click it to continue editing.
    3. Go to the Populate Matrix tab, and select your new Favorites list from the drop-down.
    4. Click Add. Right-click a record in the list to view its datasheet, or remove it from the Matrix.
    5. Click Next to go to the Train tab.
  7. On the Train tab, click Start Training.
Tip: When a model is sent for training:
  • A feature matrix is created from the Feature Set and record list.
  • An asynchronous job is created. The current status of the job is displayed in the MI Job Queue and MI Machine Learning.
  • The feature matrix is sent to the Alchemite engine, and used to train and test the Alchemite machine learning algorithm.
  • The result (a trained model) is returned by the engine and the model’s status changes to Trained in the Training app model list.

Exercise 3: Model Quality and re-training a model

In this exercise, we will effectively re-train the model with an extra input feature to see if we can improve the quality of its predictions.

  1. Once your model has finished training, find it in the Training app model list. It will now have a value in the Model Quality column. Model Quality is a measure of how statistically likely this trained model is to be true, based on the least squares regression of all features. This model’s quality is relatively low at 0.497, most likely because it was trained on a small dataset. Adding more data may make the model predictions more reliable.
  2. Create an untrained copy of your original model.
    1. Select the model in the list, and click Clone model
    2. Click Save to create and open the cloned model.
  3. Edit the Feature Set of the cloned model.
    1. On the Define Matrix tab, add the Border power attribute as an Input feature.
    2. Click Next.
    3. Do not change anything on the Populate Matrix tab. If you wanted to append or update training data, you would add or replace records here.
    4. Click Next.
    5. On the Train tab, click Start training.
  4. Compare the two models in the model list once training is complete. The cloned model has a Model Quality of 0.752, indicating a higher likelihood that its results accurately represent the real-life parameter space.