
{"id":6061,"date":"2022-07-18T10:43:41","date_gmt":"2022-07-18T09:43:41","guid":{"rendered":"https:\/\/dasini.net\/blog\/?p=6061"},"modified":"2025-08-12T11:09:15","modified_gmt":"2025-08-12T10:09:15","slug":"iris-data-set-with-mysql-heatwave-machine-learning-zeppelin","status":"publish","type":"post","link":"https:\/\/dasini.net\/blog\/2022\/07\/18\/iris-data-set-with-mysql-heatwave-machine-learning-zeppelin\/","title":{"rendered":"Iris Data Set with MySQL HeatWave Machine Learning  &#038; Zeppelin"},"content":{"rendered":"\n<p>MySQL&nbsp;\u2013&nbsp;<em>The world\u2019s most popular open source database<\/em>&nbsp;\u2013&nbsp;is also probably the most popular database in the Cloud. <br><strong><a href=\"https:\/\/www.oracle.com\/mysql\/heatwave\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"HeatWave\u2014In-Memory Query Accelerator with Built-in ML\">MySQL HeatWave<\/a><\/strong><a href=\"https:\/\/www.oracle.com\/mysql\/heatwave\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"HeatWave\u2014In-Memory Query Accelerator with Built-in ML\"><strong> database service<\/strong><\/a> is THE MySQL PaaS, a fully managed cloud service in <a href=\"https:\/\/www.oracle.com\/cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Oracle Cloud Infrastructure\">Oracle Cloud Infrastructure<\/a> (<a href=\"https:\/\/www.oracle.com\/cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Oracle Cloud Infrastructure\">OCI<\/a>). <\/p>\n\n\n\n<p class=\"has-text-align-justify\"><strong>The only MySQL service 100% developed, managed and supported by the MySQL Team.<\/strong><\/p>\n\n\n\n<p>In short:<\/p>\n\n\n\n<figure class=\"wp-block-pullquote has-vivid-red-color has-text-color has-small-font-size\" style=\"border-radius:100px;font-style:italic;font-weight:300\"><blockquote><p><strong>MySQL<\/strong> <strong>HeatWave<\/strong> is a massively parallel, high performance, in-memory query accelerator that accelerates MySQL performance by orders of magnitude for <strong>analytics<\/strong> workloads, <strong>mixed<\/strong> workloads, and <strong>Machine Learning<\/strong>.<\/p><\/blockquote><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\" id=\"HeatWave_architecture\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dev.mysql.com\/doc\/heatwave\/en\/images\/hw-ml-genai-architecture.png?ssl=1\" alt=\"Architectural Features of MySQL HeatWave\"\/><figcaption class=\"wp-element-caption\"><strong><em><span style=\"text-decoration: underline;\">MySQL HeatWave Architecture<\/span><\/em><\/strong><\/figcaption><\/figure>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>For your <span style=\"text-decoration: underline;\">analytics<\/span> needs you can explore and visualize your data using a data visualization tool like Tableau, Qlik,<a href=\"https:\/\/docs.oracle.com\/en\/cloud\/paas\/analytics-cloud\/acsgs\/what-is-oracle-analytics-cloud.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Getting Started with Oracle Analytics Cloud\"> Oracle Analytics Cloud<\/a>, Apache Superset  (see: <a href=\"https:\/\/dasini.net\/blog\/2022\/06\/09\/explore-visualize-your-mysql-heatwave-data-with-superset\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Explore &amp; visualize your MySQL HeatWave data with Superset\">Explore &amp; visualize your MySQL HeatWave data with Superset<\/a>)&#8230;<\/p>\n\n\n\n<p>For your <span style=\"text-decoration: underline;\">Machine Learning<\/span> needs you can use a notebook like Jupyter, Apache Zeppelin (see: <a href=\"https:\/\/dasini.net\/blog\/2022\/07\/05\/interactively-explore-visualize-your-mysql-heatwave-data-with-apache-zeppelin\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Interactively explore &amp; visualize your MySQL HeatWave data with Apache Zeppelin\">Interactively explore &amp; visualize your MySQL HeatWave data with Apache Zeppelin<\/a>),&#8230;<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>In this article I will show you how easy it is to use the <strong>Machine Learning capabilities<\/strong>&nbsp;of&nbsp;<a href=\"https:\/\/www.oracle.com\/mysql\/heatwave\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>MySQL HeatWave<\/strong><\/a>. We will use the famous <a href=\"https:\/\/en.wikipedia.org\/wiki\/Iris_flower_data_set\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Iris flower data set\">Iris dataset<\/a> and we&rsquo;re going to build, train, deploy and explain a machine learning model within <strong>MySQL HeatWave<\/strong> using <strong><a href=\"https:\/\/dasini.net\/blog\/2022\/07\/05\/interactively-explore-visualize-your-mysql-heatwave-data-with-apache-zeppelin\/\" target=\"_blank\" rel=\"noopener\" title=\"https:\/\/dasini.net\/blog\/2022\/07\/05\/interactively-explore-visualize-your-mysql-heatwave-data-with-apache-zeppelin\/\">Apache Zeppelin<\/a><\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Integrating Apache Zeppelin with HeatWave MySQL\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/eWNFaSY28B4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Prerequisites<\/h1>\n\n\n\n<p>To be able to reproduce this tutorial,  you must have a MySQL HeatWave instance running (<a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-before-you-begin.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave ML - Before You Begin\">details here<\/a> and also <a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/mysql-database\/doc\/heatwave.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave - Oracle Cloud Infrastructure Documentation\">RTFM<\/a>).<br>The data used in this article are available on my GitHub account <a href=\"https:\/\/github.com\/freshdaz\/MySQL_HeatWave_ML_Iris\/blob\/main\/MySQL_HeatWave-iris_ML.sql\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p>You need a MySQL client to load the data into MySQL HeatWave. I&rsquo;m using <a href=\"https:\/\/dev.mysql.com\/doc\/mysql-shell\/8.0\/en\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL Shell\">MySQL Shell<\/a>.<br> Furthermore if you want to use Zeppelin (although optional because we&rsquo;re going to run mainly sql queries) , it must be properly setup. <br>Please read: <a href=\"https:\/\/dasini.net\/blog\/2022\/07\/05\/interactively-explore-visualize-your-mysql-heatwave-data-with-apache-zeppelin\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Interactively explore &amp; visualize your MySQL HeatWave data with Apache Zeppelin\">Interactively explore &amp; visualize your MySQL HeatWave data with Apache Zeppelin<\/a><br>You can also download the <a href=\"https:\/\/github.com\/freshdaz\/Iris-Data-Set-with-MySQL-HeatWave-Machine-Learning-and-Zeppelin_notebook\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Iris-Data-Set-with-MySQL-HeatWave-Machine-Learning-and-Zeppelin_notebook\">Zeppelin notebook here<\/a>.<\/p>\n\n\n\n<p>Finally, you might need to install some packages. <br>ex: (<em><a href=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/pip\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"pip documentation\">pip<\/a> <a href=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/pip_install\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"pip install documentation\">install<\/a> pandas numpy unlzw3 sklearn seaborn matplotlib jupyter grpcio protobuf<\/em>)<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">MySQL HeatWave ML<\/h1>\n\n\n\n<p><strong>MySQL HeatWave ML makes it easy to use machine learning, whether you are a novice user or an experienced ML practitioner<\/strong>.&nbsp;<\/p>\n\n\n\n<p>You provide the data, and HeatWave ML analyzes the characteristics of the data and creates an optimized machine learning model that you can use to generate predictions and explanations.&nbsp;<\/p>\n\n\n\n<p>HeatWave ML supports <strong>supervised<\/strong> machine learning. That is, it creates a machine learning model by analyzing a labeled dataset to learn patterns that enable it to predict labels based on the features of the dataset. HeatWave ML supports both <strong>classification<\/strong> and <strong>regression<\/strong> models.&nbsp;<br>More information <a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/heatwave-machine-learning.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave ML\">here<\/a>.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"444\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHWML-In-database-Machine-Learning.png?resize=800%2C444&#038;ssl=1\" alt=\"In-database Machine Learning with MySQL HeatWave\" class=\"wp-image-6078\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHWML-In-database-Machine-Learning.png?resize=800%2C444&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHWML-In-database-Machine-Learning.png?resize=300%2C166&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHWML-In-database-Machine-Learning.png?resize=768%2C426&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHWML-In-database-Machine-Learning.png?w=1233&amp;ssl=1 1233w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\"><span style=\"text-decoration: underline;\"><em><strong>In-database Machine Learning with MySQL HeatWave<\/strong><\/em><\/span><\/figcaption><\/figure>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>All HeatWave ML operations are initiated by running&nbsp;<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/call.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL CALL Statement\"><code>CALL<\/code><\/a>&nbsp;or&nbsp;<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/select.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>SELECT<\/code><\/a>&nbsp;statements, which can be easily integrated into your applications.<\/p>\n\n\n\n<p>HeatWave ML routines include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-train.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_TRAIN<\/code><\/a>: Trains a machine learning model for a given training dataset.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-row.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_PREDICT_ROW<\/code><\/a>: Makes predictions for one or more rows of data.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-table.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_PREDICT_TABLE<\/code><\/a>: Makes predictions for a table of data.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-row.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_EXPLAIN_ROW<\/code><\/a>: Explains predictions for one or more rows of data.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-table.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_EXPLAIN_TABLE<\/code><\/a>: Explains predictions for a table of data.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-score.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_SCORE<\/code><\/a>: Computes the quality of a model.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-model-load.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_MODEL_LOAD<\/code><\/a>: Loads a machine learning model for predictions and explanations.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-model-unload.html\"><code>ML_MODEL_UNLOAD<\/code><\/a>: Unloads a machine learning model.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Load the data<\/h1>\n\n\n\n<p>In a real life scenario, your data are already inside your MySQL instance. Although you might need to prepare them upfront, because the relevant data set must be inside a single table.<\/p>\n\n\n\n<p>I&rsquo;m using MySQL Shell (installed on the server that host Zeppelin) to load the data into the <em><a href=\"https:\/\/github.com\/freshdaz\/MySQL_HeatWave_ML_Iris\" target=\"_blank\" rel=\"noreferrer noopener\">iris_ML<\/a><\/em> schema. The dump file &#8211; <em><strong>MySQL_HeatWave-iris_ML.sql<\/strong><\/em> &#8211; was previously uploaded to the server into <em>\/home\/ubuntu<\/em>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">mysqlsh --version\n\nmysqlsh myUser:MyP4s$W0rd@10.0.1.2 --sql -f \/home\/ubuntu\/MySQL_HeatWave-iris_ML.sql<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"78\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_01.png?resize=554%2C78&#038;ssl=1\" alt=\"\" class=\"wp-image-6110\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_01.png?w=554&amp;ssl=1 554w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_01.png?resize=300%2C42&amp;ssl=1 300w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"501\" height=\"96\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_02-1.png?resize=501%2C96&#038;ssl=1\" alt=\"\" class=\"wp-image-6115\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_02-1.png?w=501&amp;ssl=1 501w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_02-1.png?resize=300%2C57&amp;ssl=1 300w\" sizes=\"auto, (max-width: 501px) 100vw, 501px\" \/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The dump contains 4 tables:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>iris<\/em> : the reference table ie source of truth, production data<\/li>\n\n\n\n<li><em>iris_test<\/em> : contains the test dataset<\/li>\n\n\n\n<li><em>iris_train<\/em> : contains the training dataset<\/li>\n\n\n\n<li><em>iris_validate<\/em> : contains the validation dataset<\/li>\n<\/ul>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Check HeatWave ML status<\/h1>\n\n\n\n<p>HeatWave ML is enable by default as soon as your MySQL HeatWave Cluster is active.<\/p>\n\n\n\n<p>The <em><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/heatwave-status-variables.html#statvar_rapid_ml_status\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"The status of HeatWave ML. Possible values are ON and OFF.\">rapid_ml_status<\/a><\/em> variable provides the status of HeatWave ML:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SHOW GLOBAL STATUS LIKE 'rapid_ml_status';<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"197\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_03.png?resize=800%2C197&#038;ssl=1\" alt=\"\" class=\"wp-image-6119\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_03.png?resize=800%2C197&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_03.png?resize=300%2C74&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_03.png?resize=768%2C190&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_03.png?w=851&amp;ssl=1 851w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>HeatWave ML is up and running \\o\/<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Data exploration<\/h1>\n\n\n\n<p>The first step of any project based on data is to look at the data. <br>Summarize and visualize the data will help you to have a better understanding of the project.<\/p>\n\n\n\n<p>It may surprise you but SQL provides some commands and functions for data exploration, although much less extensive than R or Python \ud83d\ude42 :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">-- Tables structure \nDESCRIBE iris_ML.iris;  -- Reference table (production table)\nDESCRIBE iris_ML.iris_train; -- Table that contains the training dataset\nDESCRIBE iris_ML.iris_test; -- Test dataset table\nDESCRIBE iris_ML.iris_validate; -- Validation dataset table<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"273\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_04.png?resize=800%2C273&#038;ssl=1\" alt=\"\" class=\"wp-image-6242\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_04.png?resize=800%2C273&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_04.png?resize=300%2C102&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_04.png?resize=768%2C262&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_04.png?w=863&amp;ssl=1 863w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">-- Number of rows\nSELECT count(*) FROM iris_ML.iris;\nSELECT count(*) FROM iris_ML.iris_train;\nSELECT count(*) FROM iris_ML.iris_test;\nSELECT count(*) FROM iris_ML.iris_validate;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"481\" height=\"572\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_05.png?resize=481%2C572&#038;ssl=1\" alt=\"\" class=\"wp-image-6243\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_05.png?w=481&amp;ssl=1 481w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_05.png?resize=252%2C300&amp;ssl=1 252w\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" \/><\/figure>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><em><span style=\"text-decoration: underline;\">iris<\/span><\/em> <em>simulate<\/em> the live production table. It contains the original data (150 rows) and actually it will not be used (as is) by HeatWave ML.<br>To keep things simple as possible in this article, <em>iris<\/em> as the same structure than <em>iris_train<\/em>. But in a real life scenario it will most likely not the case.<br>This production table may have additional columns like for example: a primary key, timestamp, etc&#8230; any useful business related information that are not relevant for building our model.<\/p>\n\n\n\n<p><em><span style=\"text-decoration: underline;\">iris_train<\/span><\/em> contains the&nbsp;training dataset a subset of iris table (120 rows), used to train the machine learning model.<br>This table is typically a subset of the reference table(s).<\/p>\n\n\n\n<p><em><span style=\"text-decoration: underline;\">iris_test<\/span><\/em> contains the test dataset  a subset of iris table (30 rows), different than <em>iris_train<\/em>. Its structure is almost similar to <em>iris_train<\/em> but without the target column (class) .<\/p>\n\n\n\n<p><em><span style=\"text-decoration: underline;\">iris_validate<\/span><\/em> contains the validation dataset (30 rows). Same data than <em>iris_test<\/em> but same structure than <em>iris_train<\/em> in other words this table has the target column (class).<\/p>\n\n\n\n<p>General requirements for HeatWave ML <a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/heatwave-ml-prepare-data.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave ML - Preparing Data\">here<\/a>.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">-- Data sample\nSELECT * FROM iris_ML.iris LIMIT 10;\n\n\n-- Class distribution\nSELECT class, count(*) FROM iris_ML.iris GROUP BY class;\n\n\n-- Summary Statistics\nSELECT MIN(sepal_length), MAX(sepal_length), ROUND(AVG(sepal_length), 2), ROUND(STD(sepal_length), 2) FROM iris_ML.iris;\nSELECT MIN(sepal_width), MAX(sepal_width), ROUND(AVG(sepal_width), 2), ROUND(STD(sepal_width), 2) FROM iris_ML.iris;\nSELECT MIN(petal_length), MAX(petal_length), ROUND(AVG(petal_length), 2), ROUND(STD(petal_length), 2) FROM iris_ML.iris;\nSELECT MIN(petal_width), MAX(petal_width), ROUND(AVG(petal_width), 2), ROUND(STD(petal_width), 2) FROM iris_ML.iris;<\/code><\/pre>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"232\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6253\" data-id=\"6253\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_06-1.png?resize=800%2C232&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_06-1.png?resize=800%2C232&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_06-1.png?resize=300%2C87&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_06-1.png?resize=768%2C222&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_06-1.png?w=1081&amp;ssl=1 1081w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"147\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6254\" data-id=\"6254\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_07-1.png?resize=800%2C147&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_07-1.png?resize=800%2C147&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_07-1.png?resize=300%2C55&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_07-1.png?resize=768%2C142&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_07-1.png?w=1308&amp;ssl=1 1308w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"215\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6252\" data-id=\"6252\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_08-1.png?resize=800%2C215&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_08-1.png?resize=800%2C215&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_08-1.png?resize=300%2C81&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_08-1.png?resize=768%2C206&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_08-1.png?w=845&amp;ssl=1 845w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<p>Class distribution is well balanced:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Iris-virginica: 50 rows<\/li>\n\n\n\n<li>Iris-setosa: 50 rows<\/li>\n\n\n\n<li>Iris-versicolor: 50 rows<\/li>\n<\/ul>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Data visualization<\/h1>\n\n\n\n<p>Visualize your data is probably the more convenient way to explore and understand them.<\/p>\n\n\n\n<p>Below a little Python script to generate some graphs.<\/p>\n\n\n\n<p>Beforehand, I had to edit the Zeppelin python interpreter &#8211; <em><strong>zeppelin.python<\/strong><\/em> &#8211; and replace python by <strong>python3<\/strong>:<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"280\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/zeppelin-05-python-interpreter-update.png?resize=614%2C280&#038;ssl=1\" alt=\"Update zeppelin.python:  replace python by python3\" class=\"wp-image-6173\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/zeppelin-05-python-interpreter-update.png?w=614&amp;ssl=1 614w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/zeppelin-05-python-interpreter-update.png?resize=300%2C137&amp;ssl=1 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><figcaption class=\"wp-element-caption\"><strong><span style=\"text-decoration: underline;\"><em>zeppelin.python<\/em>: python3:<\/span><\/strong><\/figcaption><\/figure>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The interpreter is: <strong>%python.ipython <\/strong><br>The script is going to connect to MySQL HeatWave, thus you must <strong>update the database information<\/strong> (host, database, user, password)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">%python.ipython\n\n## Edit python interpreter on Zeppelin - zeppelin.python: python3  instead of python\n## Update host, database, user and password (from you're MySQL HeatWave)\n\n\n\nimport mysql.connector as connection\nimport pandas as pd\nimport seaborn as sns\nsns.set_palette('husl')\n%matplotlib inline\nimport matplotlib.pyplot as plt\n\n\ntry:\n    mydb = connection.connect(host=\"10.0.1.2\", database='iris_ML', user=\"&lt;user&gt;\", passwd=\"&lt;password&gt;\", port=3306)\n    query = \"SELECT * FROM iris;\"\n    data = pd.read_sql(query,mydb)\n    mydb.close() #close the connection\nexcept Exception as e:\n    my_conn.close()\n    print(str(e))\n\ndata.head()\n\ndata.info()\n\ndata.describe()\n\ndata['class'].value_counts()\n\ng = sns.pairplot(data, hue='class', markers='*')\n\nplt.show()<\/code><\/pre>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The information above come from the <em>Iris<\/em> table (reference table). It could interesting to compare these data with the training dataset (<em>iris_train<\/em>) and the test dataset in order to evaluate the quality of these samples. <\/p>\n\n\n\n<p>Replace {query = \u00ab\u00a0SELECT * FROM iris;\u00a0\u00bb} <br>by {query = \u00ab\u00a0SELECT * FROM iris_train;\u00a0\u00bb} <br>and then by {query = \u00ab\u00a0SELECT * FROM iris_test;\u00a0\u00bb}<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Training a Model<\/h1>\n\n\n\n<p>Now we have a better understanding of the data, let&rsquo;s moving forward and train the model. We&rsquo;re having a classification  problem.<\/p>\n\n\n\n<p>The&nbsp;<a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-train.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_TRAIN<\/code><\/a>&nbsp;routine, when run on a training dataset, produces a trained machine learning (ML) model.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\"># Train the model using ML_TRAIN\n\nCALL sys.ML_TRAIN('iris_ML.iris_train', 'class', JSON_OBJECT('task', 'classification'), @iris_model);<\/code><\/pre>\n\n\n\n<p>You can show the current model, selecting the session variable <em>@iris_model<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\">SELECT @iris_model;<\/code><\/pre>\n\n\n\n<p>The lifetime duration of a session variable is&#8230; the session lifetime duration. So when the session is closed the session variable content is lost.<\/p>\n\n\n\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-train.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave, ML_TRAIN produces a machine learning model\"><code>ML_TRAIN<\/code><\/a>&nbsp;stores the machine learning model &#8211; <em><strong>@iris_model<\/strong><\/em> &#8211; in the&nbsp;<code><strong><em><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-model-catalog.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave - The Model Catalog\">MODEL_CATALOG<\/a><\/em><\/strong><\/code>&nbsp;table:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\"># Model information\n\nSELECT model_id, model_handle, model_owner, target_column_name, train_table_name, model_type, task, model_object_size  FROM ML_SCHEMA_admin.MODEL_CATALOG;<\/code><\/pre>\n\n\n\n<p>You can take the last created model using the following query:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\">SELECT model_handle FROM ML_SCHEMA_admin.MODEL_CATALOG ORDER BY model_id DESC LIMIT 1 INTO @iris_model;<\/code><\/pre>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>When the model is created (using ML_TRAIN) you should load it into HeatWave ML (<a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-model-load.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"ML_MODEL_LOAD - \">ML_MODEL_LOAD<\/a>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\">CALL sys.ML_MODEL_LOAD(@iris_model, NULL);<\/code><\/pre>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"635\" height=\"177\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6270\" data-id=\"6270\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_09.png?resize=635%2C177&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_09.png?w=635&amp;ssl=1 635w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_09.png?resize=300%2C84&amp;ssl=1 300w\" sizes=\"auto, (max-width: 635px) 100vw, 635px\" \/><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"218\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6271\" data-id=\"6271\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_10.png?resize=660%2C218&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_10.png?w=660&amp;ssl=1 660w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_10.png?resize=300%2C99&amp;ssl=1 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"124\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6272\" data-id=\"6272\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_11.png?resize=800%2C124&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_11.png?resize=800%2C124&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_11.png?resize=300%2C46&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_11.png?resize=768%2C119&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_11.png?w=1097&amp;ssl=1 1097w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"319\" height=\"133\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6274\" data-id=\"6274\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_12.png?resize=319%2C133&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_12.png?w=319&amp;ssl=1 319w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_12.png?resize=300%2C125&amp;ssl=1 300w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Starting with <strong>HeatWave 9.0<\/strong>, you can check which models are currently loaded and active, using <code><strong><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/mys-hwaml-ml-model-active.html\" target=\"_blank\" rel=\"noopener\" title=\"ML_MODEL_ACTIVE\">sys.ML_MODEL_ACTIVE<\/a><\/strong><\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SQL>\nCALL sys.ML_MODEL_ACTIVE('current', @model_info);\nQuery OK, 0 rows affected (0.7321 sec)\n\n\nSELECT JSON_PRETTY(@model_info)\\G\n*************************** 1. row ***************************\nJSON_PRETTY(@model_info): [\n  {\n    \"total model size(bytes)\": 13951\n  },\n  {\n    \"iris_ML.iris_train_admin_1657554696\": {\n      \"task\": \"classification\",\n      \"notes\": \"\",\n      \"chunks\": 1,\n      \"format\": \"HWMLv2.0\",\n      \"n_rows\": 120,\n      \"status\": \"Ready\",\n      \"options\": {\n        \"task\": \"classification\",\n        \"model_explainer\": \"permutation_importance, shap\",\n        \"optimization_metric\": \"accuracy\",\n        \"prediction_explainer\": \"permutation_importance\"\n      },\n      \"n_columns\": 4,\n      \"pos_class\": null,\n      \"column_names\": [\n        \"sepal_length\",\n        \"sepal_width\",\n        \"petal_length\",\n        \"petal_width\"\n      ],\n      \"model_quality\": \"high\",\n      \"training_time\": 6.638953,\n      \"algorithm_name\": \"GaussianNB\",\n      \"training_score\": null,\n      \"build_timestamp\": 1740563992,\n      \"n_selected_rows\": 96,\n      \"training_params\": {\n        \"sp_arr\": null,\n        \"timezone\": null,\n        \"recommend\": \"ratings\",\n        \"force_use_X\": false,\n        \"recommend_k\": 3,\n        \"remove_seen\": true,\n        \"ranking_topk\": 10,\n        \"contamination\": null,\n        \"lsa_components\": 100,\n        \"semisupervised\": null,\n        \"ranking_threshold\": 1,\n        \"feedback_threshold\": 1\n      },\n      \"train_table_name\": \"iris_ML.iris_train\",\n      \"model_explanation\": {\n        \"shap\": {\n          \"petal_width\": 0.3578,\n          \"sepal_width\": 0.0,\n          \"petal_length\": 0.2829,\n          \"sepal_length\": 0.0\n        },\n        \"permutation_importance\": {\n          \"petal_width\": 0.3872,\n          \"sepal_width\": 0.0,\n          \"petal_length\": 0.3843,\n          \"sepal_length\": 0.0\n        }\n      },\n      \"model_object_size\": 13951,\n      \"n_selected_columns\": 2,\n      \"target_column_name\": \"class\",\n      \"optimization_metric\": \"accuracy\",\n      \"exclude_feature_names\": [],\n      \"include_feature_names\": [],\n      \"selected_column_names\": [\n        \"petal_length\",\n        \"petal_width\"\n      ],\n      \"training_drift_metric\": {\n        \"mean\": 0.018764767953578888,\n        \"variance\": 0.0008759556124732613\n      }\n    }\n  }\n]<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Generate Model Explanations<\/h1>\n\n\n\n<p>Starting with <strong>HeatWave 9<\/strong>, you can train the model explainer. That will help you to understand which features have the most influence on a prediction:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SQL>\n-- Train the model Explainer\nCALL sys.ML_EXPLAIN('iris_ML.iris_train', 'class', @iris_model, JSON_OBJECT('model_explainer', 'shap', 'prediction_explainer', 'permutation_importance'));\n\n\n-- Check the result\nSELECT JSON_PRETTY(model_explanation) \nFROM ML_SCHEMA_admin.MODEL_CATALOG \nWHERE model_handle = @iris_model\\G\n*************************** 1. row ***************************\nJSON_PRETTY(model_explanation): {\n  \"shap\": {\n    \"petal_width\": 0.3578,\n    \"sepal_width\": 0.0,\n    \"petal_length\": 0.2829,\n    \"sepal_length\": 0.0\n  },\n  \"permutation_importance\": {\n    \"petal_width\": 0.3872,\n    \"sepal_width\": 0.0,\n    \"petal_length\": 0.3843,\n    \"sepal_length\": 0.0\n  }\n}<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Row Prediction<\/h1>\n\n\n\n<p>HeatWave ML allows you to make prediction for individual rows or the entire table. <\/p>\n\n\n\n<p>Row(s) predictions are generated by running&nbsp;<code><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-row.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave, Row Prediction: ML_PREDICT_ROW\">ML_PREDICT_ROW<\/a><\/code>. <br>Data are specified in&nbsp;<code>JSON<\/code>&nbsp;format.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\"># Predict 1 Row\n\nSET @row_input = JSON_OBJECT( \n   \"sepal_length\", 7.3, \n   \"sepal_width\", 2.9, \n   \"petal_length\", 6.3, \n   \"petal_width\", 1.8\n);  \n\n\nSELECT sys.ML_PREDICT_ROW(@row_input, @iris_model);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"673\" height=\"341\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_13.png?resize=673%2C341&#038;ssl=1\" alt=\"\" class=\"wp-image-6276\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_13.png?w=673&amp;ssl=1 673w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_13.png?resize=300%2C152&amp;ssl=1 300w\" sizes=\"auto, (max-width: 673px) 100vw, 673px\" \/><\/figure>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Row Explanation<\/h1>\n\n\n\n<p>Being able to understand and explain a prediction is important in order to trust your model and to be able to explain the results. It might also be required by your local regulation.<\/p>\n\n\n\n<p><code><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-explain-row.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave , ML_EXPLAIN_ROW generates explanations for one or more rows of data\">ML_EXPLAIN_ROW<\/a><\/code>&nbsp;generates explanations for one or more rows of data. Explanations help you understand which features have the most influence on a prediction. <br>Feature importance is presented as a value ranging from -1 to 1. <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A positive value indicates that a feature contributed toward the prediction. <\/li>\n\n\n\n<li>A negative value indicates that the feature contributed toward a different prediction<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\"># Prediction explanation for 1 Row\n\nSET @row_input = JSON_OBJECT( \n   \"sepal_length\", 7.3, \n   \"sepal_width\", 2.9, \n   \"petal_length\", 6.3, \n   \"petal_width\", 1.8\n);    \n\n\nSELECT sys.ML_EXPLAIN_ROW(@row_input, @iris_model);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"257\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_14.png?resize=800%2C257&#038;ssl=1\" alt=\"\" class=\"wp-image-6280\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_14.png?resize=800%2C257&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_14.png?resize=300%2C96&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_14.png?resize=768%2C246&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_14.png?w=1094&amp;ssl=1 1094w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Table Prediction<\/h1>\n\n\n\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-table.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave, ML_PREDICT_TABLE generates predictions for an entire table of unlabeled data and saves the results to an output table\"><code>ML_PREDICT_TABLE<\/code><\/a>&nbsp;generates predictions for an entire table and saves the results to an output table.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\"># Generate predictions for a table \n\n-- CALL sys.ML_MODEL_LOAD(@iris_model, NULL); -- Uncomment if the model is not yet loaded\n\nDROP TABLE IF EXISTS iris_ML.iris_predictions; -- Useful if a table prediction was already generated\n\nCALL sys.ML_PREDICT_TABLE('iris_ML.iris_test', @iris_model, 'iris_ML.iris_predictions');<\/code><\/pre>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>A new table called <em>iris_predictions<\/em> is created. You can display Its first 5 rows with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\">SELECT * FROM iris_ML.iris_predictions LIMIT 5;<\/code><\/pre>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"622\" height=\"293\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6282\" data-id=\"6282\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_15.png?resize=622%2C293&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_15.png?w=622&amp;ssl=1 622w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_15.png?resize=300%2C141&amp;ssl=1 300w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"232\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6283\" data-id=\"6283\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_16.png?resize=800%2C232&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_16.png?resize=800%2C232&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_16.png?resize=300%2C87&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_16.png?resize=768%2C222&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_16.png?w=1064&amp;ssl=1 1064w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Table Explanation<\/h1>\n\n\n\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-explain-table.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave, ML_EXPLAIN_TABLE explains predictions for an entire table of unlabeled data and saves results to an output table\"><code>ML_EXPLAIN_TABLE<\/code><\/a>&nbsp;explains predictions for an entire table and saves results to an output table.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\"># Prediction explanation for a table \n\n-- CALL sys.ML_MODEL_LOAD(@iris_model, NULL); -- Uncomment if the model is not yet loaded\n\nDROP TABLE IF EXISTS iris_ML.iris_explanations;  -- Usueful if a table explanation was already done\n\nCALL sys.ML_EXPLAIN_TABLE('iris_ML.iris_test', @iris_model, 'iris_ML.iris_explanations');<\/code><\/pre>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>A new table called <em>iris_explanations<\/em> is created. You can display Its first 5 rows with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\">SELECT * FROM iris_ML.iris_explanations LIMIT 5;<\/code><\/pre>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"616\" height=\"223\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6286\" data-id=\"6286\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_17.png?resize=616%2C223&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_17.png?w=616&amp;ssl=1 616w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_17.png?resize=300%2C109&amp;ssl=1 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"306\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-6287\" data-id=\"6287\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_18.png?resize=800%2C306&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_18.png?resize=800%2C306&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_18.png?resize=300%2C115&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_18.png?resize=768%2C294&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_18.png?w=810&amp;ssl=1 810w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Scores<\/h1>\n\n\n\n<p>Scoring the model allows to assess the model&rsquo;s reliability.<\/p>\n\n\n\n<p>Models with a low score can be expected to perform poorly, producing predictions and explanations that cannot be relied upon. A low score typically indicates that the provided feature columns are not a good predictor of the target values.<\/p>\n\n\n\n<p>HeatWave ML supports a variety of scoring metrics to help you understand how your model performs across a series of benchmarks.&nbsp;<br>Details <a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-score.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave, ML_SCORE metrics\">here<\/a>.<\/p>\n\n\n\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-score.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave, ML_SCORE returns a computed metric indicating the quality of the model.\"><code>ML_SCORE<\/code><\/a>&nbsp;returns a computed metric indicating the quality of the model.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"SQL\" class=\"language-SQL\">-- This example uses the accuracy: Computes the fraction of labels a model predicts correctly\n\nCALL sys.ML_SCORE('iris_ML.iris_validate', 'class', @iris_model, 'accuracy', @accuracy_score);\n\nSELECT @accuracy_score;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"349\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_20.png?resize=583%2C349&#038;ssl=1\" alt=\"\" class=\"wp-image-6291\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_20.png?w=583&amp;ssl=1 583w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/MHW_Iris_20.png?resize=300%2C180&amp;ssl=1 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/figure>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Other metrics are also available. See <a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-score.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave - ML_SCORE\">here<\/a>.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Building ML Models with HeatWave AutoML and Apache Zeppelin: Iris Dataset Example\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/zxzvRQggNNE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Here we go!<br>We&rsquo;ve seen the machine learning life cycle.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"298\" src=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/Machine-Learning-Life-Cycle-2.png?resize=800%2C298&#038;ssl=1\" alt=\"\" class=\"wp-image-6340\" srcset=\"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/Machine-Learning-Life-Cycle-2.png?resize=800%2C298&amp;ssl=1 800w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/Machine-Learning-Life-Cycle-2.png?resize=300%2C112&amp;ssl=1 300w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/Machine-Learning-Life-Cycle-2.png?resize=768%2C286&amp;ssl=1 768w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/Machine-Learning-Life-Cycle-2.png?resize=1536%2C572&amp;ssl=1 1536w, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/07\/Machine-Learning-Life-Cycle-2.png?w=2037&amp;ssl=1 2037w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\"><span style=\"text-decoration: underline;\"><em><strong>Machine Learning Life Cycle<\/strong><\/em><\/span><\/figcaption><\/figure><\/div>\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>I told you that Machine Learning with MySQL HeatWave was easy \ud83d\ude42 <\/p>\n\n\n\n<p>You only need to use a limited set of SQL routines:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-train.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_TRAIN<\/code><\/a>: Trains a machine learning model for a given training dataset.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-row.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_PREDICT_ROW<\/code><\/a>: Makes predictions for one or more rows of data.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-table.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_PREDICT_TABLE<\/code><\/a>: Makes predictions for a table of data.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-row.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_EXPLAIN_ROW<\/code><\/a>: Explains predictions for one or more rows of data.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-predict-table.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_EXPLAIN_TABLE<\/code><\/a>: Explains predictions for a table of data.<\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/hwml-ml-score.html\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ML_SCORE<\/code><\/a>: Computes the quality of a model.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:75px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-text-align-justify has-medium-font-size\"><strong>During the last 20 years MySQL has democratized the usage of transactional databases.<br>Now with MySQL HeatWave we are in the process of democratizing Analytics and Machine Learning.<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center has-vivid-red-color has-text-color\" style=\"font-size:25px;letter-spacing:1px\"><strong>With MySQL HeatWave<\/strong>,<br><strong>valorizing your data has never been so easy<\/strong>!<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Resources<\/h1>\n\n\n\n<ul class=\"wp-block-list has-luminous-vivid-orange-color has-text-color\">\n<li><a href=\"http:\/\/dasini.net\/blog\/2021\/08\/03\/discovering-mysql-database-service-episode-1-introduction\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Introduction to the series&nbsp;Discovering MySQL Database Service\">Introduction to the series&nbsp;<strong><em>Discovering MySQL HeatWave Database Service<\/em><\/strong><\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dasini.net\/blog\/2022\/07\/05\/interactively-explore-visualize-your-mysql-heatwave-data-with-apache-zeppelin\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Interactively explore &amp; visualize your MySQL HeatWave data with Apache Zeppelin\">Interactively explore &amp; visualize your MySQL HeatWave data with Apache Zeppelin<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.oracle.com\/mysql\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL Database Service (MDS)\">MySQL HeatWave Database Service (MDS)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave User Guide\">MySQL HeatWave User Guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/heatwave\/en\/heatwave-machine-learning.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL HeatWave ML\">HeatWave ML<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/mysql-database\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Documentation of MySQL Database Service \">Documentation of MySQL Database Service <\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.oracle.com\/cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Oracle Cloud Infrastructure (OCI)\">Oracle Cloud Infrastructure (OCI)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/libraries\/glossary\/glossary-intro.htm\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Oracle Cloud Infrastructure Glossary\">Oracle Cloud Infrastructure Glossary<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.oracle.com\/cloud\/free\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Oracle Cloud Free Tier\">Oracle Cloud Free Tier<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mysql.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL &#8212; The world&rsquo;s most popular open source database<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/mysql-shell\/8.0\/en\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"MySQL Shell\">MySQL Shell<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.oracle.com\/mysql\/heatwave\/performance\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Performance comparison of MySQL HeatWave with Snowflake, Amazon Redshift, Amazon Aurora, and Amazon RDS for MySQL\">Performance comparison of MySQL HeatWave with Snowflake, Amazon Redshift, Amazon Aurora, and Amazon RDS for MySQL<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/blogs.oracle.com\/cloud-infrastructure\/post\/oracles-latest-mysql-heatwave-cloud-database-simplifies-use-of-machine-learning\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Oracle\u2019s latest MySQL HeatWave cloud database simplifies use of machine learning\">Oracle\u2019s latest MySQL HeatWave cloud database simplifies use of machine learning<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/freshdaz\/Zeppelin_HeatWave_Notebooks\/archive\/refs\/heads\/main.zip\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Zeppelin HeatWave's Notebooks from this article\">Download the notebooks<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/zeppelin.apache.org\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Apache Zeppelin\">Apache Zeppelin<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/archive.ics.uci.edu\/ml\/datasets\/iris\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Iris Data Set\">Iris Data Set<\/a><\/li>\n<\/ul>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><a href=\"https:\/\/www.linkedin.com\/groups\/12524512\/\" target=\"_blank\" rel=\"noopener\" title=\"Olivier DASINI on Linkedin\">Follow me on Linkedin<\/a><\/p>\n\n\n\n<p>Watch my videos on my <a href=\"https:\/\/www.youtube.com\/channel\/UC12TulyJsJZHoCmby3Nm3WQ\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Olivier's MySQL Channel\">YouTube channel<\/a> and <a href=\"https:\/\/www.youtube.com\/channel\/UC12TulyJsJZHoCmby3Nm3WQ\/?sub_confirmation=1\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Subscribe\">subscribe<\/a>.<\/p>\n\n\n\n<p>My <a href=\"https:\/\/www.slideshare.net\/freshdaz\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Olivier DASINI on Slideshare\">Slideshare account<\/a>.<\/p>\n\n\n\n<p>My <a href=\"https:\/\/speakerdeck.com\/freshdaz\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Olivier DASINI on Speaker Deck\">Speaker Deck account<\/a>.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\"><strong>Thanks for using HeatWave &amp; MySQL!<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/4\/41\/Iris_versicolor_3.jpg\/1920px-Iris_versicolor_3.jpg\" alt=\"Iris Versicolor\"\/><figcaption class=\"wp-element-caption\"><strong><em><span style=\"text-decoration: underline;\">Iris Versicolor<\/span><\/em><\/strong><\/figcaption><\/figure><\/div>","protected":false},"excerpt":{"rendered":"<p>During the last 20 years MySQL has democratized the usage of transactional databases.<br \/>\nNow with MySQL HeatWave we are in the process of democratizing Analytics and Machine Learning.<\/p>\n<p>With MySQL HeatWave,<br \/>\nvalorizing your data has never been so easy!<\/p>\n<p>In this article I will show you how easy it is to use the Machine Learning capabilities of MySQL HeatWave. We will use the famous Iris dataset and we\u2019re going to build, train, deploy and explain a machine learning model within MySQL HeatWave using Apache Zeppelin.<\/p>\n","protected":false},"author":2,"featured_media":5803,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[203,339],"tags":[306,1751,349],"class_list":["post-6061","post","type-post","status-publish","format-standard","hentry","category-mysql-en","category-tuto-en","tag-cloud","tag-ml-en","tag-tuto-en"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/HW_ML.png?fit=1012%2C431&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9LfWW-1zL","jetpack-related-posts":[{"id":5915,"url":"https:\/\/dasini.net\/blog\/2022\/07\/05\/interactively-explore-visualize-your-mysql-heatwave-data-with-apache-zeppelin\/","url_meta":{"origin":6061,"position":0},"title":"Interactively explore &#038; visualize your MySQL HeatWave data with Apache Zeppelin","author":"Olivier DASINI","date":"5 juillet 2022","format":false,"excerpt":"In this article I will show you how to properly configure Apache Zeppelin in order to take advantage of the Analytics and Machine Learning capabilities of MySQL HeatWave the MySQL in-memory query accelerator.","rel":"","context":"Dans &quot;Machine Learning&quot;","block_context":{"text":"Machine Learning","link":"https:\/\/dasini.net\/blog\/category\/machine-learning-en\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=1050%2C600 3x"},"classes":[]},{"id":5762,"url":"https:\/\/dasini.net\/blog\/2022\/06\/09\/explore-visualize-your-mysql-heatwave-data-with-superset\/","url_meta":{"origin":6061,"position":1},"title":"Explore &#038; visualize your MySQL HeatWave data with Superset","author":"Olivier DASINI","date":"9 juin 2022","format":false,"excerpt":"In this article I will show you how to properly configure Apache Superset in order to take advantage of a high performance, in-memory query accelerator: MySQL HeatWave.","rel":"","context":"Dans &quot;MySQL&quot;","block_context":{"text":"MySQL","link":"https:\/\/dasini.net\/blog\/category\/mysql-en\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2022\/06\/Configure-Heatwave-Cluster.png?resize=1050%2C600 3x"},"classes":[]},{"id":4872,"url":"https:\/\/dasini.net\/blog\/2021\/08\/31\/discovering-mysql-database-service-episode-5-create-a-mysql-db-system-from-a-mysql-shell-dump\/","url_meta":{"origin":6061,"position":2},"title":"Discovering MySQL Database Service &#8211; Episode 5 &#8211; Create a MySQL DB system from a MySQL Shell dump","author":"Olivier DASINI","date":"31 ao\u00fbt 2021","format":false,"excerpt":"MySQL, the world\u2019s most popular open source database, is available as a managed cloud service in Oracle Cloud Infrastructure (OCI) under the name of MySQL Database Service (MDS). This is the fifth episode of \u201cDiscovering MySQL Database Service\u201c, a series of tutorials where I will show you, step by step,\u2026","rel":"","context":"Dans &quot;Cloud&quot;","block_context":{"text":"Cloud","link":"https:\/\/dasini.net\/blog\/category\/cloud\/"},"img":{"alt_text":"MySQL Database Service","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4662,"url":"https:\/\/dasini.net\/blog\/2021\/08\/03\/discovering-mysql-database-service-episode-1-introduction\/","url_meta":{"origin":6061,"position":3},"title":"Discovering MySQL Database Service &#8211; Episode 1 &#8211; Introduction","author":"Olivier DASINI","date":"3 ao\u00fbt 2021","format":false,"excerpt":"This is the first episode of \u201cDiscovering MySQL Database Service\u201c, a series of tutorials where I will show you, step by step, how to use MySQL Database Service and some other Oracle Cloud Infrastructure services. Like any series, in this episode I\u2019m going to give you some context and set\u2026","rel":"","context":"Dans &quot;Cloud&quot;","block_context":{"text":"Cloud","link":"https:\/\/dasini.net\/blog\/category\/cloud\/"},"img":{"alt_text":"MySQL Database Service","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4719,"url":"https:\/\/dasini.net\/blog\/2021\/08\/10\/discovering-mysql-database-service-episode-2-create-a-compartment\/","url_meta":{"origin":6061,"position":4},"title":"Discovering MySQL Database Service &#8211; Episode 2 &#8211; Create a compartment","author":"Olivier DASINI","date":"10 ao\u00fbt 2021","format":false,"excerpt":"This is the second episode of \u201cDiscovering MySQL Database Service\u201c, a series of tutorials where I will show you, step by step, how to use MySQL Database Service and some other Oracle Cloud Infrastructure services. In the previous episode we've introduced the different components that we will use during this\u2026","rel":"","context":"Dans &quot;Cloud&quot;","block_context":{"text":"Cloud","link":"https:\/\/dasini.net\/blog\/category\/cloud\/"},"img":{"alt_text":"MySQL Database Service","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4943,"url":"https:\/\/dasini.net\/blog\/2021\/09\/07\/discovering-mysql-database-service-episode-6-update-the-private-subnet-security-list\/","url_meta":{"origin":6061,"position":5},"title":"Discovering MySQL Database Service \u2013 Episode 6 \u2013 Update the Private Subnet Security List","author":"Olivier DASINI","date":"7 septembre 2021","format":false,"excerpt":"MySQL, the world\u2019s most popular open source database, is available as a managed cloud service in Oracle Cloud Infrastructure (OCI) under the name of MySQL Database Service (MDS). This is the sixth episode of \u201cDiscovering MySQL Database Service\u201c, a series of tutorials where I will show you, step by step,\u2026","rel":"","context":"Dans &quot;Cloud&quot;","block_context":{"text":"Cloud","link":"https:\/\/dasini.net\/blog\/category\/cloud\/"},"img":{"alt_text":"MySQL Database Service","src":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dasini.net\/blog\/wp-content\/uploads\/2021\/06\/MDS_car_801x600.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/6061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/comments?post=6061"}],"version-history":[{"count":254,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/6061\/revisions"}],"predecessor-version":[{"id":8114,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/posts\/6061\/revisions\/8114"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/media\/5803"}],"wp:attachment":[{"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/media?parent=6061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/categories?post=6061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dasini.net\/blog\/wp-json\/wp\/v2\/tags?post=6061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}