diff --git a/labs/MLSummit21/images/confirm-success-condas.png b/labs/MLSummit21/images/confirm-success-condas.png index 2fea0595..a6ff30a2 100644 Binary files a/labs/MLSummit21/images/confirm-success-condas.png and b/labs/MLSummit21/images/confirm-success-condas.png differ diff --git a/labs/MLSummit21/images/notebook-session.png b/labs/MLSummit21/images/notebook-session.png index 5a2064da..cb151e65 100644 Binary files a/labs/MLSummit21/images/notebook-session.png and b/labs/MLSummit21/images/notebook-session.png differ diff --git a/labs/MLSummit21/lab-2-install-conda.md b/labs/MLSummit21/lab-2-install-conda.md index e709f0b9..707516d6 100644 --- a/labs/MLSummit21/lab-2-install-conda.md +++ b/labs/MLSummit21/lab-2-install-conda.md @@ -29,11 +29,11 @@ In this lab you will: * Leanr how to run a notebook in a conda environment kernel ### Prerequisites -* You have successfully completed labs 0 and 1. +* You have successfully completed labs 0 and 1. ## **STEP 1:** Open a Notebook Session -1. Click on the notebook session you created during Lab 1 or Lab 0. +1. Click on the notebook session you created during Lab 1 or Lab 0. 1. CLick on **Open**. It will open in a separate browser tab. If prompted to sign-in, provide your Oracle Cloud credentials. ![](./images/ns-open.png) @@ -47,9 +47,9 @@ There is a menu across the top of the screen. For this lab, the most interesting ## **STEP 2:** Installing Your First Conda Environment -The Environment Explorer is an extension in JupyterLab that provides an interface to manage the lifecycle of conda environments. A Conda Environment is a collection of libraries, programs, components and metadata. Think of them as halfway between a Python virtual environment and a Docker image. In the notebook session you can install a series of [pre-built conda environments (Data Science Environments)](https://docs.oracle.com/en-us/iaas/data-science/using/conda_environ_list.htm) or [create](https://docs.oracle.com/en-us/iaas/data-science/using/conda_create_conda_env.htm) and [publish your own conda environments](https://docs.oracle.com/en-us/iaas/data-science/using/conda_publishs_object.htm) from a notebook session. Published conda environments are the ones that you create or modify and want to share among team members or reuse in Jobs or Model Deployments. In addition to the Environment Explorer, the notebook session also comes with the `odsc conda` CLI. The `odsc` CLI lets you manage the lifecycle of conda environments. +The Environment Explorer is an extension in JupyterLab that provides an interface to manage the lifecycle of conda environments. A Conda Environment is a collection of libraries, programs, components and metadata. Think of them as halfway between a Python virtual environment and a Docker image. In the notebook session you can install a series of [pre-built conda environments (Data Science Environments)](https://docs.oracle.com/en-us/iaas/data-science/using/conda_environ_list.htm) or [create](https://docs.oracle.com/en-us/iaas/data-science/using/conda_create_conda_env.htm) and [publish your own conda environments](https://docs.oracle.com/en-us/iaas/data-science/using/conda_publishs_object.htm) from a notebook session. Published conda environments are the ones that you create or modify and want to share among team members or reuse in Jobs or Model Deployments. In addition to the Environment Explorer, the notebook session also comes with the `odsc conda` CLI. The `odsc` CLI lets you manage the lifecycle of conda environments. -Before you can use a conda environment in your notebook session, you need to install it first. You will install a pre-built Data Science Conda Environment. +Before you can use a conda environment in your notebook session, you need to install it first. You will install a pre-built Data Science Conda Environment. 1. In the *Launcher* tab, click **Environment Explorer** ![](./images/notebook_launcher.png) @@ -57,26 +57,26 @@ Before you can use a conda environment in your notebook session, you need to ins 1. In the Environment Explorer tab, select the **Data Science Conda Environment** filter button, select **CPU** architecture filter, then scroll down until you find the **TensorFlow 2.7 for CPU on Python 3.7** conda. (If you see no results, use the refresh button on the right side of the filter bar of the Environment Explorer.) ![](./images/select-tf-env.png) - 1. Click on the caret on the right side, copy the install command + 1. Click on the caret on the right side, copy the install command ![](./images/copy-install-tf-env-command.png) 1. Go back to the *Launcher* tab and select **Terminal** to open a terminal window. - 1. **Paste the command** into the terminal window and hit **Return** to execute it. + 1. **Paste the command** into the terminal window and hit **Return** to execute it. The command that you previously copied is: ``` - odsc conda install -s tensorflow27_p37_cpu_v1 + odsc conda install -s tensorflow27_p37_cpu_v1 ``` 1. You will receive a prompt related to what version number you want. Press `Enter` to select the default. - + ![](./images/install-in-progress.png) It takes about 3-5 minutes for the conda package to be installed. ## **STEP 3** Confirm that the Conda Environment is Installed -You can confirm that the conda environment has been successfully installed by going back to the launcher tab and see that a new kernel has been create with the slugname of the conda environment: +You can confirm that the conda environment has been successfully installed by going back to the launcher tab and see that a new kernel has been create with the slugname of the conda environment: ![](./images/confirm-success-condas.png) **Congratulations! You can proceed to the next lab.** @@ -87,5 +87,3 @@ You can confirm that the conda environment has been successfully installed by go * [A YouTube Screencast on Installing and Publishing Conda Environments in OCI Data Science](https://www.youtube.com/watch?v=j6wVqpn6lqg&list=PLKCk3OyNwIzv6CWMhvqSB_8MLJIZdO80L&index=9&t=4s) * [A YouTube Screencast on Creating Your Own Conda Environment From Scratch](https://www.youtube.com/watch?v=3_qyf_GJUuM&list=PLKCk3OyNwIzv6CWMhvqSB_8MLJIZdO80L&index=13) * [Blog Post Announcing the new Conda Environments Feature in Notebook Sessions](https://blogs.oracle.com/ai-and-datascience/post/new-conda-environment-feature-available-in-oracle-cloud-infrastructure-data-science) - - diff --git a/labs/MLSummit21/lab-3-python-model.md b/labs/MLSummit21/lab-3-python-model.md index 83906b91..4b874446 100644 --- a/labs/MLSummit21/lab-3-python-model.md +++ b/labs/MLSummit21/lab-3-python-model.md @@ -2,9 +2,9 @@ ## Introduction -This lab will guide you through a practical example of how to build, train and save a machine learning model. +This lab will guide you through a practical example of how to build, train and save a machine learning model. -The dataset is a fictional data set which contains 1,470 rows. There are 36 features. 22 features are ordinal, 11 are categorical, and 3 are constant values. The features include basic demographic information, compensation level, job characteristics, job satisfaction and employee performance metrics. The data is not balanced as fewer employees leave than stay. The goal will be to predict employee retention. +The dataset is a fictional data set which contains 1,470 rows. There are 36 features. 22 features are ordinal, 11 are categorical, and 3 are constant values. The features include basic demographic information, compensation level, job characteristics, job satisfaction and employee performance metrics. The data is not balanced as fewer employees leave than stay. The goal will be to predict employee retention. While this example uses a classifier, the steps learned with this exercise are applicable to many other types of machine learning models. @@ -19,7 +19,7 @@ In this lab you will: ### Prerequisites -* Successful completion of Labs 0, 1, and 2. +* Successful completion of Labs 0, 1, and 2. ## **STEP 1:** Open your Notebook Session @@ -31,13 +31,14 @@ In this lab you will: A notebook has been prepared containing all the necessary Python code to explore the data, train the model, evaluate the model, and store it in the model catalog. This notebook has already been configured with a conda environment. - 1. In the file browser, navigate to the directory **/home/datascience/lab/labs/MLSummit21/Notebooks/**. This directory was created in Lab 1 when you unzip this repository in your notebook session. + 1. In the file browser, navigate to the directory **/home/datascience/lab/labs/MLSummit21/Notebooks/**. This directory was created in Lab 1 when you unzip this repository in your notebook session. 1. Open the notebook **1-model-training.ipynb** (double-click on it). A new tab opens in the workspace on the right. Notice in the upper right corner of the notebook tab, it displays the name of the conda environment being used by this notebook. Confirm that the name you see the slugname of the TensorFlow conda environment (`tensorflow27_p37_cpu_v1`) - + ![](./images/confirm-kernel.png) - 1. Now you will work in the notebook. Scroll through each cell and read the explanations. When you encounter a `code` cell, execute it (using **shift + enter**) and view the results. For executable cells, the ""[ ]"" changes to a "[\*]" while executing, then a number when complete "[1]". (If you run short on time, you can use the *Run* menu to run the remaining cells and the review the results.) + 1. Now you will work in the notebook. Scroll through each cell and read the explanations. When you encounter a `code` cell, execute it (using **shift + enter**) and view the results. For executable cells, the ""[ ]"" changes to a "[\*]" while executing, then a number when complete "[1]". (If you run short on time, you can use the *Run* menu to run the remaining cells and the review the results.) + **You can proceed to the next lab.** diff --git a/labs/MLSummit21/lab-7-wrap.md b/labs/MLSummit21/lab-7-wrap.md index 448a935b..53fabafa 100644 --- a/labs/MLSummit21/lab-7-wrap.md +++ b/labs/MLSummit21/lab-7-wrap.md @@ -1,4 +1,4 @@ -# Lab 8 - Summary and Wrap Up +# Lab 7 - Summary and Wrap Up ## Summary @@ -11,7 +11,7 @@ In this workshop, we have gone through the simple steps of building and deployin * Deploy the model * Deactivate resources -The purpose of this workshop was to give you an overview of the OCI Data Science service without going into the details and more advanced scenarios. Although the workshop simulates and end-to-end story, typical machine learning use cases are more complex. We have a series of additional resources and tutorials that cover some of these more advanced use cases. Try them out in your OCI tenancy: +The purpose of this workshop was to give you an overview of the OCI Data Science service without going into the details and more advanced scenarios. Although the workshop simulates and end-to-end story, typical machine learning use cases are more complex. We have a series of additional resources and tutorials that cover some of these more advanced use cases. Try them out in your OCI tenancy: * [Create your own conda environment from scratch](https://blogs.oracle.com/ai-and-datascience/post/creating-a-new-conda-environment-from-scratch-in-oci-data-science) @@ -21,16 +21,16 @@ The purpose of this workshop was to give you an overview of the OCI Data Science * [Calling OCI Data Flow from Data Science](https://github.com/oracle/oci-data-science-ai-samples/blob/master/conda_environment_notebooks/pyspark/dataflow.ipynb) -* ADS Library is now available on [PyPi](https://pypi.org/project/oracle-ads/). Try it on your laptop! +* ADS Library is now available on [PyPi](https://pypi.org/project/oracle-ads/). Try it on your laptop! -## Stay in Touch! +## Stay in Touch! -* Read our blog posts at [https://blogs.oracle.com/ai-and-datascience/](https://blogs.oracle.com/ai-and-datascience/) +* Read our blog posts at [https://blogs.oracle.com/ai-and-datascience/](https://blogs.oracle.com/ai-and-datascience/) -* [Watch our tutorials on YouTube](https://www.youtube.com/playlist?list=PLKCk3OyNwIzv6CWMhvqSB_8MLJIZdO80L). +* [Watch our tutorials on YouTube](https://www.youtube.com/playlist?list=PLKCk3OyNwIzv6CWMhvqSB_8MLJIZdO80L). * Our service documentation is also available at [https://docs.oracle.com/en-us/iaas/data-science/using/data-science.htm](https://docs.oracle.com/en-us/iaas/data-science/using/data-science.htm) -* The ADS SDK Documentation is available at [https://docs.oracle.com/en-us/iaas/tools/ads-sdk/latest/index.html](https://docs.oracle.com/en-us/iaas/tools/ads-sdk/latest/index.html). +* The ADS SDK Documentation is available at [https://docs.oracle.com/en-us/iaas/tools/ads-sdk/latest/index.html](https://docs.oracle.com/en-us/iaas/tools/ads-sdk/latest/index.html). * ADS is now available on [PyPi](https://pypi.org/project/oracle-ads/). diff --git a/labs/MLSummit21/notebooks/1-model-training.ipynb b/labs/MLSummit21/notebooks/1-model-training.ipynb index 70925cc0..b89ae9b6 100644 --- a/labs/MLSummit21/notebooks/1-model-training.ipynb +++ b/labs/MLSummit21/notebooks/1-model-training.ipynb @@ -46,7 +46,7 @@ "metadata": {}, "outputs": [], "source": [ - "#!pip install oracle-ads==2.5.6" + "!pip install oracle-ads==2.5.6" ] }, { @@ -125,12 +125,17 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The code cell below will work in you are in the **Ashburn** region. \n", + "The code cell below will work only if your notebook session is running in the **Ashburn** region. If not use these instructions to download it to your local computer, then upload it to the notebook session, then use it to create a dataset. \n", "\n", - "The file is also available publicly at this url: \n", + "1. Download the file from this public url and save it on your local computer: \n", "https://objectstorage.us-ashburn-1.oraclecloud.com/n/bigdatadatasciencelarge/b/hosted-ds-datasets/o/synthetic%2Forcl_attrition.csv\n", "\n", - "You can download it and drop it in the file browser of JupyterLab." + "2. Use the Upload Files button (or drag and drop) to upload the csv file to the same folder as 1-model-training.ipynb\n", + "\n", + "3. Run the following instruction instead of the code cell below.\n", + "```\n", + "employees = DatasetFactory.open(\"synthetic_orcl_attrition.csv\", format='csv', delimiter=\",\", target=\"Attrition\").set_positive_class('Yes')\n", + "```" ] }, {