DEVELOPER BLOG

HOME > DEVELOPER BLOG > 【Introduction to Machine Learning】Launching Jupyter Notebook with Amazon SageMaker - PrismScaler

【Introduction to Machine Learning】Launching Jupyter Notebook with Amazon SageMaker - PrismScaler

1. Introduction

Hello! We are a writer team from Definer Inc. Launching Jupyter Notebook with Amazon SageMaker provides a convenient and scalable environment for data scientists, researchers, and developers to create, collaborate, and execute data science workflows. Amazon SageMaker is a fully managed machine learning service provided by Amazon Web Services (AWS) that simplifies the process of building, training, and deploying machine learning models at scale. With SageMaker, you can easily set up Jupyter Notebook instances and leverage powerful computing resources to perform data analysis, model training, and experimentation. In this issue, you are wondering how to start Jupyter Notebook on your Amazon SageMaker notebook instance. Let's take a look at the actual screens and resources to explain in detail.

2. Purpose/Use Cases

The purpose of launching Jupyter Notebook with Amazon SageMaker is to provide a feature-rich and managed environment for data scientists and developers to leverage the capabilities of Jupyter Notebooks along with the infrastructure scalability and ease of use provided by SageMaker. Here are some key purposes and benefits of launching Jupyter Notebook with SageMaker: (1) Seamless Integration (2) Scalable Computing Resources (3) Collaboration and Version Control (4) Pre-installed Libraries and Frameworks (5) Data Access and Management (6) Integrated Model Training and Deployment (7) Cost Optimization

3. What is Amazon SageMaker?

First, a brief review of Amazon SageMaker. Amazon SageMaker is a fully managed machine learning platform that allows you to rapidly develop, train, and deploy machine learning models. The flow from instance creation, model building, training, and deployment can be performed as a Jupyter Notebook interface.   We will also review Jupyter Notebook. Jupyter Notebook is an integrated development environment that allows you to write and run Python and other languages from a web browser. It is an indispensable tool for data analysis.

4. Launching a notebook instance of Amazon SageMaker

Let's get started by launching Jupyter Notebook on a notebook instance of Amazon SageMaker.   (1) Launching a Notebook Instance: To launch a Jupyter Notebook instance in Amazon SageMaker, follow these steps: Log in to the AWS Management Console. Navigate to the Amazon SageMaker service. Click on "Notebook" and then "Notebook Instances". Click on the "Create Notebook Instance" button. Provide a unique name for your notebook instance. Choose an instance type that suits your requirements. In this case, "ml.t3.medium" is selected as the minimal instance type. You can choose different instance types based on your desired compute capabilities and budget. Specify the amount of storage volume you need for your notebook instance. If required, choose a VPC (Virtual Private Cloud) and security settings for network access to your notebook instance. Optionally, you can provide an IAM role to grant necessary permissions to the notebook instance. Click on the "Create Notebook Instance" button.     (2) Start Jupyter Notebook After creating the notebook instance, it will take a few minutes to start. Once the instance is in the "InService" state, you can access the Jupyter Notebook interface by clicking on the "Open Jupyter" link. The selected instance type, such as "ml.t3.medium," determines the available compute resources for your notebook instance. It influences factors like CPU, memory, and GPU capabilities, which can impact the performance and cost of your notebook environment. Choosing the right instance type depends on your specific workload requirements and resource needs. Launching the notebook instance in Amazon SageMaker sets up a managed Jupyter Notebook environment in the cloud. This environment provides a web-based interface where you can create, edit, and run Jupyter Notebooks to perform data analysis, build machine learning models, and run experiments. When the status becomes "In Service", click "Open Jupyter" from Actions. When Jupyter starts up, click "New" → "Terminal" to start the terminal.     (3) Download the notebook Download the notebook with the following command. When you return to the Jupyter screen, you will see that the notebook's modules have been downloaded in the directory.  
sh-4.2$ bash
(base) [ec2-user@ip-xx-xx-xx-xx ~]$ ls
anaconda3  LICENSE                  Nvidia_Cloud_EULA.pdf  SageMaker         sample-notebooks-1667474731  tools
examples   nvidia-acknowledgements  README                 sample-notebooks  src                          tutorials
(base) [ec2-user@ip-xx-xx-xx-xx ~]$ cd SageMaker/
(base) [ec2-user@ip-xx-xx-xx-xx SageMaker]$ wget http://bit.ly/sagemaker-notebooks -O sagemaker-notebooks.zip
--2022-11-03 11:30:26--  http://bit.ly/sagemaker-notebooks
Resolving bit.ly (bit.ly)... 67.199.248.10, 67.199.248.11
Connecting to bit.ly (bit.ly)|67.199.248.10|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://s3-ap-northeast-1.amazonaws.com/samejima-handson/sagemaker_handson.zip [following]
--2022-11-03 11:30:26--  https://s3-ap-northeast-1.amazonaws.com/samejima-handson/sagemaker_handson.zip
Resolving s3-ap-northeast-1.amazonaws.com (s3-ap-northeast-1.amazonaws.com)... 52.219.152.48, 52.219.136.154, 52.219.197.104, ...
Connecting to s3-ap-northeast-1.amazonaws.com (s3-ap-northeast-1.amazonaws.com)|52.219.152.48|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 77781 (76K) [application/zip]
Saving to: ‘sagemaker-notebooks.zip’

100%[=================================================================================>] 77,781      --.-K/s   in 0.01s

2022-11-03 11:30:26 (6.28 MB/s) - ‘sagemaker-notebooks.zip’ saved [77781/77781]

(base) [ec2-user@ip-xx-xx-xx-xx SageMaker]$ unzip sagemaker-notebooks.zip
Archive:  sagemaker-notebooks.zip
   creating: sagemaker-notebooks/
  inflating: sagemaker-notebooks/.DS_Store
   creating: sagemaker-notebooks/chainer_mnist/
  inflating: sagemaker-notebooks/chainer_mnist/chainer_mnist.ipynb
  inflating: sagemaker-notebooks/chainer_mnist/chainer_mnist.py
  inflating: sagemaker-notebooks/chainer_mnist/daemon.json
  inflating: sagemaker-notebooks/chainer_mnist/input.html
  inflating: sagemaker-notebooks/chainer_mnist/setup.sh
   creating: sagemaker-notebooks/pytorch_mnist/
  inflating: sagemaker-notebooks/pytorch_mnist/input.html
  inflating: sagemaker-notebooks/pytorch_mnist/mnist.py
  inflating: sagemaker-notebooks/pytorch_mnist/pytorch_mnist.ipynb
  inflating: sagemaker-notebooks/pytorch_mnist/setup.sh
   creating: sagemaker-notebooks/random_cut_forest/
  inflating: sagemaker-notebooks/random_cut_forest/random_cut_forest.ipynb
   creating: sagemaker-notebooks/transfer_learning/
  inflating: sagemaker-notebooks/transfer_learning/Image-classification-transfer-learning.ipynb
   creating: sagemaker-notebooks/xgboost_mnist/
   creating: sagemaker-notebooks/xgboost_mnist/images/
  inflating: sagemaker-notebooks/xgboost_mnist/images/mnist.png
  inflating: sagemaker-notebooks/xgboost_mnist/xgboost_mnist_ja.ipynb
  inflating: sagemaker-notebooks/chainer_mnist/.DS_Store
   creating: sagemaker-notebooks/random_cut_forest/.ipynb_checkpoints/
  inflating: sagemaker-notebooks/random_cut_forest/.ipynb_checkpoints/random_cut_forest-checkpoint.ipynb
  inflating: sagemaker-notebooks/pytorch_mnist/.DS_Store
   creating: sagemaker-notebooks/xgboost_customer_churn/
  inflating: sagemaker-notebooks/xgboost_customer_churn/xgboost_customer_churn.ipynb
(base) [ec2-user@ip-xx-xx-xx-xx SageMaker]$                

5. Cited/Referenced Articles

6. About the proprietary solution "PrismScaler"

・PrismScaler is a web service that enables the construction of multi-cloud infrastructures such as AWS, Azure, and GCP in just three steps, without requiring development and operation. ・PrismScaler is a web service that enables multi-cloud infrastructure construction such as AWS, Azure, GCP, etc. in just 3 steps without development and operation. ・The solution is designed for a wide range of usage scenarios such as cloud infrastructure construction/cloud migration, cloud maintenance and operation, and cost optimization, and can easily realize more than several hundred high-quality general-purpose cloud infrastructures by appropriately combining IaaS and PaaS.  

7. Contact us

This article provides useful introductory information free of charge. For consultation and inquiries, please contact "Definer Inc".

8. Regarding Definer

・Definer Inc. provides one-stop solutions from upstream to downstream of IT. ・We are committed to providing integrated support for advanced IT technologies such as AI and cloud IT infrastructure, from consulting to requirement definition/design development/implementation, and maintenance and operation. ・We are committed to providing integrated support for advanced IT technologies such as AI and cloud IT infrastructure, from consulting to requirement definition, design development, implementation, maintenance, and operation. ・PrismScaler is a high-quality, rapid, "auto-configuration," "auto-monitoring," "problem detection," and "configuration visualization" for multi-cloud/IT infrastructure such as AWS, Azure, and GCP.