Machine learning has become pervasive, and businesses are scrambling to introduce machine learning and AI based functionality in their products. The biggest challenge is shortage of people with technical knowledge to deliver a machine learning based project. Now, with the interactive console for machine learning in MySQL HeatWave (aka MySQL HeatWave AutoML), even business analysts can easily create and manage machine learning models. Organizations can focus on building features that will add value to their customers without worrying about availability of data science savvy resources. They can interactively and rapidly build models, make predictions, and generate explanations without any additional cost using interactive console in MySQL HeatWave. 

Interactive console for MySQL HeatWave is an integrated environment which provides users the ability to manage the database schema objects, run interactive queries, monitor performance, and use machine learning capabilities such that a business analyst can easily develop applications, manage data objects, and machine learning models. User can train machine learning models, score, and explain them, run predictions and What If scenarios to view the impact of feature changes on model outcome.

Interactive console in MySQL HeatWave

To illustrate how user can manage machine learning models in the interactive console, let us build a machine learning model based on the bank marketing dataset available in UCI machine learning repository. The objective of the machine learning model based on this dataset is to predict client’s response to the marketing campaign using phone call to sell bank term deposit. Since client’s response will be either ‘Yes’ or ‘No’, we need to build a classification model.

Create Training and Test Dataset

Interactive console supports data management functionality in the Workspaces tab. Split the bank marketing dataset in train dataset and test dataset. Create train table to store the train dataset and test table to store test dataset. The train table will be used to train the model and the test table will be used to evaluate the model.

Training and Test Dataset

Create Model (Training)

Interactive console supports model management functionality in the HeatWave AutoML tab. All the models created in the current DB System are displayed along with details such as model name, model state, prediction column, training table, algorithm, training score and the model creation date. Select the training dataset, the target column, and the columns from the selected training dataset to be included for training. Choose the machine learning task as Classification for the bank marketing dataset.

Optionally, click ‘Advanced’ menu to show advanced options. In the ‘Advanced’ menu, select the optimization metric and algorithms to be considered for creating the model. By default, ‘neg_log_loss’ will be used as the optimization metric and all the supported algorithms for the Classification machine learning task will be displayed. Click the ‘Create’ button to train the model. 

Create Model

While creating the model, the automated machine learning pipeline performs data preprocessing, algorithm selection, feature selection, hyper-parameter tuning and creates model explanations. Thus, a user can build highly sophisticated machine learning models without any ML expertise.

Evaluate Model

Once the bank marketing model is created, user should evaluate the model to check model quality. This step involves computing model score, checking model explanation, generating predictions, viewing prediction explanations, and performing What If analysis.

Creating an optimal model is an iterative process. Model building in MySQL HeatWave AutoML is extremely fast (25x speedup on an average compared to Redshift ML) which enables user to score and explain the model and add additional data features if needed and retrain the model to quickly achieve the desired model quality.

Evaluate Model

Create Predictions

Predictions can be generated in the interactive console by selecting a data source with matching columns as that of the training dataset but with or without the target column. If the target column exists, then Prediction column highlights in red those predictions where model outcome does not match the ground truth values of the target column. By selecting a specific record from the generated predictions, user can view prediction explanations and run scenarios using What If analysis.

Create Predictions

Model and Prediction Explanations

HeatWave AutoML not only finds the most accurate ML model for the provided input tables; its integrated explainability module helps users understand and interpret the model and its predictions. Deriving insights from the data and model helps the user answer questions around what factors matter most, why the model performs the way it does, and how it can be improved.

Model explanations provides important attributes for the overall model, whereas prediction explanations identify important attributes for one or more rows of data.  Thus, in case of bank marketing example, model explanations identify call ‘duration’ and ‘month’ in which call was made as the most important attributes for the overall model. However, for a specific bank customer ‘age’ or ‘loan’ can be more important factors.

Model and Prediction Explanations

What If Analysis

Interactive console supports What If analysis. User can change values of certain features of a data record and compare the model outcome with the original values (aka baseline). It also shows the comparison of prediction explanations between updated record and baseline. Interpretation of comparison is provided as text to make it easy for the user to understand.

In case of bank marketing model, as per prediction explanation for a data record, month had the largest impact towards predicting that the customer will not purchase the term deposit and call duration had the most impact on the customer buying the term deposit. After changing the month from ‘May’ to ‘December’ and increasing call duration from 238 seconds to 1000 seconds model predicted that customer would purchase the term deposit. 

What If Analysis

In summary, the interactive console for machine learning in MySQL HeatWave provides an integrated environment to manage data as well as machine learning models at no additional cost. It makes it easy to manage machine learning models even for a business user so that organizations can focus on their business objective rather than technical details of building models. User can run What If analysis based on the prediction explanations and run scenarios to identify the data features that can be changed to revert the model outcome. There is no additional cost for MySQL HeatWave AutoML.