Predictive example pipelines run in the Design Advisor
app, and help
formulators predict properties for formulations. The following examples are available:
Top-Level Pipeline
The examples use the Design Advisor template. On the top level, the
main components are the Advisor Configuration subpipeline, which
controls user input, and Advisor Calculation subpipeline, which
performs the calculations. Both branches converge at the output anchor, which renders the
output:

In the Parameters tab, EntityData is example
data for the pipeline when it is run in data mode. InitializationData
includes are dummy values that are used in data mode to simulate the advisor
configuration.
Advisor Configuration Subpipeline
The Advisor Configuration subpipeline controls the advisor
configuration dialog:

The different components control individual elements used to specify default values and
collect user input. For example, the WebUX Slider play time component
specifies the vc_play_time variable. It has a maximum value of
60 with an increment of 1. The input label
is Play time (s). There are WebUx components
for each of the configurable parameters for skin cream.
Advisor Calculation Subpipeline
The
Advisor Calculation subpipeline performs the calculations for the
advisor.

The
following is an overview of the steps performed by the subpipeline:
- Read the data and detach the nodes. This is configured to extract the billOfMaterial
nodes. For the skin cream advisor, this creates 17 data records, each corresponding to an
ingredient.
- Create targetPercentActive transforms the data from being column
name with the name of the ingredient to the ingredient being the
column name and the value being the targetPercentActive.
The data records are filtered to keep these new columns, and are then merged into a
single data record.

-
The data records are passed into the Machine Learning Workbench components. There is a component for each value to predict. They return the original
data with a new column with the prediction.
The outputs from the model are merged back into one data record.

- Python (on Server) creates the chart.
-
The main processing is done the functions onProcess and a created
function create_radar_plot. In onProcess, some
processing needs to be done before the data can be sent to
create_radar_plot.
-
The context.getGlobalProperties() function gets the global props,
which contain the configuration data required for the radar plot.
-
Two arrays are sent to the create_radar_plot function, one being the
data array, which the current data record, and the other is the
targetArray, which is an array with all the configuration data.
-
The create_radar_plot function has general logic for creating the
radar plot.
- The image produced is converted from matplotlib to bytes to be used in the
Image from Data component.
Customizing a Predictor Example Pipeline
To customize the advisor, manipulate the categories array in the
create_radar_plot function. It is first used for output column names from
the Machine Learning Workbench models to grab the value for each prediction. It is then overwritten with names without
the suffix of the model type. To use an example with your own model, you need to see what
the output column is from the model and change the array values with your
output.