Using Amazon SageMaker

In this section, we will demonstrate setting up an Amazon SageMaker notebook instance. Run a sample machine learning job and create an endpoint to host the model.

  1. Log in to AWS Management Console and go to the Amazon SageMaker console. Click on the Create notebook instance button:
  1. On the Notebook instance settings, we will create an Amazon SageMaker execution role. Click on the IAM role drop-down list and select the Create a new role option:
  1. Select the Any S3 bucket option and click on the Create role button:
  1. Specify the Notebook instance name (as SageMakerTestNotebookInstance), select the Notebook Instance type, and select the No VPC option. Click on the Create notebook instance button: 
  1. After the notebook instance is created, you should see a success message. The newly created notebook instance listed on the SageMaker Notebook instances screen. The status should change from Pending to InService.

 

  1. Click on the SageMaker notebook instance to see the details for it. Click on the Open button to open the Jupyter notebook:
  1. Navigate through the samples provided: /sample-notebooks/introduction_to_applying_machine_learning/breast_cancer_prediction.
  2. Click on the Breast Cancer Prediction.ipynb file. Select conda_python3 from the kernel drop-down menu:
  1. Create a S3 bucket (from the S3 console) and name it sagemakertestdata.
  2. Change the bucket name to the newly created bucket:
  1. Execute the code in the notebook cell by cell. The code creates a training job that can be seen on the SageMaker Jobs console. While the training job is running, you will see the Status as inProgress. The Status changes to Completed when the training is completed. 
  2. After training the linear algorithm on our data, we set up a model that can be hosted later. After we set up the model, we configure and create the hosting endpoints. You can view the endpoint configuration on the SageMaker Endpoint configuration console. Wait for the Status to change to inService.
  3. The notebook contains code for testing the model using the endpoint. Finally, execute the following cell in the notebook to delete the endpoint:
  1. Confirm that the endpoint is deleted (from the SageMaker Endpoint console).
  2. From the Actions menu on the SageMaker Notebook instances console, choose the Delete option:
  1. Click on the Delete button to confirm:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.231.245