Skip to content

Commit

Permalink
LWMS ID:11114 - Fixed the following labs (#745)
Browse files Browse the repository at this point in the history
* LWMS ID:11114 - Fixed the following labs

1. Lab1 - Create HeatWave DV Connection
2. Lab4 - Added ml_dev user for AutoML processing and updated sys.ML_TRAIN call
3. Lab5 - Changed connection user to ml_dev and fixed source code

* LWMS ID:11114 - @carmenberdant1 requested changes on Lab 5 task 3, step 6 the image is not showing correctly.

LWMS ID:11114 - @carmenberdant1 requested changes on Lab 5 task 3, step 6 the image is not showing correctly.

* LWMS ID:11114 - Added comments to Lab 4 Task 1.

LWMS ID:11114 - Added comments to Lab 4 Task 1.
  • Loading branch information
plforacle authored Jan 13, 2025
1 parent 57c91d7 commit 1e24f66
Show file tree
Hide file tree
Showing 29 changed files with 49 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ You may now **proceed to the next lab**

- **Author** - Perside Foster, MySQL Solution Engineering
- **Contributors** - Mandy Pang, MySQL Principal Product Manager, Priscila Galvao, MySQL Solution Engineering, Nick Mader, MySQL Global Channel Enablement & Strategy Manager
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, July 2023
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, January 2025
2 changes: 1 addition & 1 deletion heatwave-machine-learning/connect-dbs/connect-dbs.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@ You may now **proceed to the next lab**
- **Author** - Perside Foster, MySQL Solution Engineering
- **Contributor** - Frédéric Descamps, MySQL Community Manager
- **Last Updated By/Date** - Perside Foster,Jul 2023
- **Last Updated By/Date** - Perside Foster, January 2025
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion heatwave-machine-learning/create-dbs/create-dbs.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,4 @@ You may now **proceed to the next lab**.

- **Contributors** - Mandy Pang, MySQL Principal Product Manager, Priscila Galvao, MySQL Solution Engineering, Nick Mader, MySQL Global Channel Enablement & Strategy Manager, Frédéric Descamps, MySQL Community Manager

- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, July 2023
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering,January 2025
10 changes: 6 additions & 4 deletions heatwave-machine-learning/develop/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,16 @@ In this lab, you will be guided through the following tasks:
```
```bash
<copy> sudo wget https://objectstorage.us-ashburn-1.oraclecloud.com/p/EQTHbWQcztdMROAhjbJBgPdyK8gqU-khhM871SJCxsmsMHqJlGvGrJ6z5uSQlxot/n/mysqlpm/b/mysql_iris_ml_app/o/iris_app.zip </copy>
<copy> sudo wget https://objectstorage.us-ashburn-1.oraclecloud.com/p/9WLLKC8BD0tfBdIJ98_x7dXLN9Kvow9ZPtBD35KVwzdqoIQshX1WBBMBB7AqIGMT/n/mysqlpm/b/mysql_iris_ml_app/o/iris_app.zip </copy>
```
```bash
<copy>sudo unzip iris_app.zip</copy>
```
3. Configure the application to connect to MySQL HeatWave. <br>
**Note** This application uses the "ml_dev" database username that you should have used to create the Machine Learning Model.
3. Configure the application to connect to MySQL HeatWave.
Replace the database IP in config.php file with your heatwave database IP and save the file.
```bash
Expand All @@ -166,7 +168,7 @@ In this lab, you will be guided through the following tasks:
![Iris App Execution](./images/iris-web-php.png "iris-app-php run")
6. Insert test values in the text boxes (you can use the examples in the page) and press '**Submit**' button to see the prediction:
6. Insert test values in the text boxes (you can use the examples in the page) and press '**Submit**' button. Page down to see the prediction, explanation, and score:
![Test Iris App](./images/iris-web-php-result.png "iris-app-php test ")
Expand All @@ -175,4 +177,4 @@ In this lab, you will be guided through the following tasks:
- **Author** - Perside Foster, MySQL Solution Engineering, Harsh Nayak, MySQL Solution Engineering
- **Contributors** - Mandy Pang, MySQL Principal Product Manager, Priscila Galvao, MySQL Solution Engineering, Nick Mader, MySQL Global Channel Enablement & Strategy Manager, Marco Carlessi, MySQL Solution Engineering
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, Jul 2023
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering,January 2025
Binary file modified heatwave-machine-learning/develop/images/apache-test-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified heatwave-machine-learning/develop/images/iris-web-php.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified heatwave-machine-learning/develop/images/php-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 38 additions & 12 deletions heatwave-machine-learning/do-heatwave-ml/do-heatwave-ml.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ _Estimated Time:_ 10 minutes

In this lab, you will be guided through the following task:

- Create Machine Learning user ml_dev
- Load Iris Data into HeatWave
- Create and test Machine Learning Model

### Prerequisites

Expand All @@ -36,31 +38,55 @@ In this lab, you will be guided through the following task:

(Example: **ssh -i id_rsa opc@132.145.17....**)

2. On the command line, connect to MySQL using the MySQL Shell client tool with the following command:
2. In this lab we will create the user **ml_dev** and set the privilieges to build the AutoML model.

3. On the command line, connect to the MySQL **admin** user using the MySQL Shell client tool with the following command:

```bash
<copy>mysqlsh -uadmin -p -h 10.... -P3306 --sql </copy>
```

![Connect](./images/heatwave-load-shell.png "heatwave-load-shell ")

3. In this lab we use the administrative account previously created, but if you want to use a dedicated MySQL user, please remember to grant the following privileges to use HeatWave AutoML
a. Create the ml\_dev user used to create the schema for the machine learning datasets

```bash
<copy>CREATE USER 'ml_dev'@'%' IDENTIFIED BY 'Welcome#123';</copy>
```

b. Grant ml\_dev the required privileges on the ml_data schema that contains the machine learning datasets

```bash
<copy>GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT ON ml_data.* TO 'ml_dev'@'%';</copy>
```

c. Grant ml\_dev the required privileges on the ML_SCHEMA_ml_dev schema that contains the machine learning development objects

```bash
<copy>GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT ON ML_SCHEMA_ml_dev.* TO 'ml_dev'@'%';</copy>
```

a. SELECT and ALTER privileges on the schema that contains the machine learning datasets
d. Grant ml\_dev SELECT and EXECUTE privileges on the MySQL sys schema where HeatWave AutoML routines reside;

```bash
<copy>GRANT SELECT, ALTER ON schema_name.* TO 'user_name'@'%';</copy>
<copy>GRANT SELECT, EXECUTE ON sys.* TO 'ml_dev'@'%';</copy>
```

b. SELECT and EXECUTE on the MySQL sys schema where HeatWave AutoML routines reside; for example:
e. Exit mysqlsh for admin user

```bash
<copy>GRANT SELECT, EXECUTE ON sys.* TO 'user_name'@'%';</copy>
<copy>\q</copy>
```

## Task 2: load training and test data

1. To Create the Machine Learning schema and tables on the MySQL HeatWave DB System perform download the sample database with this command:
1. On the command line, connect to the MySQL **ml\_dev** user using the MySQL Shell client tool with the following command:

```bash
<copy>mysqlsh -uml_dev -p -h 10.... -P3306 --sql </copy>
```

2. To Create the Machine Learning schema and tables on the MySQL HeatWave DB System perform download the sample database with this command:

a. Click on this link to **Download file [iris-ml-data.txt](files/iris-ml-data.txt)** to your local machine
b. Open iris-ml-data.txt from your local machine with notepad
Expand All @@ -72,9 +98,9 @@ In this lab, you will be guided through the following task:
![MDS iris data execute](./images/iris-ml-data-execute.png "iris-ml-data-execute ")
2. View the content of your machine Learning schema (ml_data)
3. View the content of your machine Learning schema (ml_data)
a. Connected to the new database ml_data
a. Connected to the new database ml_data
```bash
<copy>use ml_data; </copy>
Expand All @@ -93,13 +119,13 @@ In this lab, you will be guided through the following task:
1. Train the model using ML_TRAIN. Since this is a classification dataset, the classification task is specified to create a classification model:
```bash
<copy>CALL sys.ML_TRAIN('ml_data.iris_train', 'class',JSON_OBJECT('task', 'classification'), @iris_model);</copy>
<copy>CALL sys.ML_TRAIN('ml_data.iris_train', 'class', NULL, @iris_model);</copy>
```
2. When the training operation finishes, the model handle is assigned to the @iris_model session variable, and the model is stored in your model catalog. You can view the entry in your model catalog using the following query:
```bash
<copy>SELECT model_id, model_handle, train_table_name FROM ML_SCHEMA_admin.MODEL_CATALOG;</copy>
<copy>SELECT model_id, model_handle, train_table_name FROM ML_SCHEMA_ml_dev.MODEL_CATALOG;</copy>
```
3. Load the model into HeatWave AutoML using ML\_MODEL\_LOAD routine:
Expand Down Expand Up @@ -224,4 +250,4 @@ In this lab, you will be guided through the following task:
- **Contributors** - Salil Pradhan, Principal Product Manager,
Nick Mader, MySQL Global Channel Enablement & Strategy Manager
Marco Carlessi, MySQL Solution Engineering
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, Jul 2023
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, January 2025
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified heatwave-machine-learning/do-heatwave-ml/images/show-ml-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion heatwave-machine-learning/introduction/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ In this lab, you will be guided through the following steps:
- **Contributors** - Salil Pradhan, Principal Product Manager,
Nick Mader, MySQL Global Channel Enablement & Strategy Manager
Marco Carlessi, MySQL Solution Engineering
- **Last Updated By/Date** - Marco Carlessi, MySQL Solution Engineering, Jul 2023
- **Last Updated By/Date** - Marco Carlessi, MySQL Solution Engineering, January 2025
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion heatwave-machine-learning/stop-services/stop-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ In this lab, you will be guided through the following task:

- **Author** - Perside Foster, MySQL Principal Solution Engineering
- **Contributors** - Mandy Pang, MySQL Principal Product Manager, Nick Mader, MySQL Global Channel Enablement & Strategy Manager
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, July 2023
- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, January 2025
61 changes: 0 additions & 61 deletions heatwave-machine-learning/workshops/ocw23-freetier/index.html

This file was deleted.

59 changes: 0 additions & 59 deletions heatwave-machine-learning/workshops/ocw23-freetier/manifest.json

This file was deleted.

0 comments on commit 1e24f66

Please sign in to comment.