Build train and deploy model in sagemaker | sagemaker tutorial | sagemaker pipeline

Unfold Data Science
21 Feb 202317:33

Summary

TLDRこのビデオでは、Amazon SageMakerを使用して機械学習モデルを構築、トレーニング、そしてデプロイするステップバイステップのプロセスを解説します。技術的なセッションで、AWS環境での機械学習の差異に焦点を当て、AWS SDKであるboto3やS3のデータバックアップ、モデルのハイパーパラメーター調整、デプロイメントの簡易性を紹介。最後に、AWSのハンズオンリンクを提供し、ユーザー自身で実践できるように導線を提供します。

Takeaways

  • 📚 まずはAWSのSageMaker Studioの使い方を学び、ドメインの作成方法を含むAWSの基礎を押さえることが重要です。
  • 🔍 SageMakerでは、AWSのサービスと連携する際にboto3というAWS SDKライブラリを使用し、Python環境でAWSサービスと通信します。
  • 📈 モデルのトレーニングには、SageMakerのイメージURIを用いて、AWSが提供する特定の機械学習アルゴリズムを直接使用できます。
  • 💾 データの取り扱いはS3バケットを中心に行われ、データのバックアップやモデルのトレーニング・検証に使用されます。
  • 🛠️ モデルのトレーニング前には、データのEDA(探索的データ解析)と前処理を行い、特徴量エンジニアリングを適用して最適なモデルに向けてデータを準備します。
  • 🔧 モデルのハイパーパラメーターの調整はSageMaker内で簡単に行い、トレーニングプロセスを最適化することができます。
  • 🚀 トレーニングが完了したら、SageMakerの`deploy`メソッドを用いてモデルを簡単に展開し、エンドポイントを作成することができます。
  • 🔗 モデルのエンドポイントを作成することで、APIや第三者システムへの接続が可能で、モデルの応用範囲が広がります。
  • 🗑️ プロジェクト終了後は、エンドポイントやS3バケットのクリーンアップを行って料金の発生を防ぐことが推奨されます。
  • 🔬 SageMakerを活用することで、データサイエンスや機械学習プロジェクトをクラウド上で効率的に実行し、スケーラビリティや管理性が向上します。
  • 👍 このビデオの内容が気に入った場合は、好評コメントやいいねを残すことで、さらなるAWS関連のビデオコンテンツが提供される可能性が高まります。

Q & A

  • ビデオで説明されているステップはどのようなプロセスを表していますか?

    -ビデオでは、Amazon SageMakerを使用して機械学習モデルを構築、トレーニング、そしてデプロイするステップバイステップのプロセスが説明されています。

  • Amazon SageMakerスタジオで最初に行うべきことは何ですか?

    -最初に行うべきことは、SageMakerセッションを開くことです。これは、SageMakerでアクティビティを実行するためのセッションを作成するものです。

  • データのインポートと環境設定とはどのような意味ですか?

    -データのインポートと環境設定とは、モデルを構築する際に必要なデータをAWSから取得し、そのデータをPandasで確認し、S3にアップロードするプロセスを指します。

  • boto3とは何であり、なぜAWS環境で重要なのですか?

    -boto3はAWS SDKのPythonライブラリで、Python環境でAWSサービスとやり取りするために使用されます。AWS環境で機械学習モデルを構築する際には、boto3を使用してAWSサービスと通信する必要があります。

  • モデルのトレーニングに使用されるXGBoostのイメージURIはどのように取得するのですか?

    -モデルのトレーニングに使用されるXGBoostのイメージURIは、SageMakerのimage_urisモジュールから取得することができます。

  • トレーニングデータと検証データはどのようにS3にアップロードするのですか?

    -トレーニングデータと検証データは、boto3を使用してS3にアップロードします。boto3のsession.resourceメソッドを使ってS3バケットにデータをアップロードします。

  • SageMakerのトレーニングモデルの定義には何が必要ですか?

    -SageMakerのトレーニングモデルの定義には、コンテナ、ロール、インスタンス数、インスタンスタイプ、出力パス、およびSageMakerセッションが必要です。

  • モデルのデプロイメント時に使用されるデプロイメソッドとは何ですか?

    -モデルのデプロイメント時に使用されるデプロイメソッドは、SageMakerのestimatorオブジェクトのdeployメソッドです。これにより、指定されたインスタンスタイプと数でモデルのエンドポイントを作成することができます。

  • シリアルライザーとは何であり、モデルのデプロイメントにどのように役立つのですか?

    -シリアルライザーは、推論エンドポイントのためのデータのシリアル化を実装するメソッドです。モデルのデプロイメント時には、CSVシリアルライザーを使用して、CSV形式のデータがエンドポイントに送信されるように変換されます。

  • モデルのトレーニングジョブが完了した後、エンドポイントを削除する理由は何ですか?

    -モデルのトレーニングジョブが完了した後、エンドポイントを削除することは、エンドポイントが実行されている間は課金されるためです。エンドポイントを削除することで、不要なコストを回避できます。

Outlines

00:00

😀 SageMakerで機械学習モデルの構築・学習・展開

このセクションでは、Amazon SageMakerを使用して機械学習モデルを構築、学習、展開するステップバイステップのプロセスが解説されています。技術的なセッションであり、AWS環境での機械学習の特有の点に焦点が当てられています。SageMaker Studioの使い方や、AWS S3からデータを取得、解凍、pandasを使用したデータの可視化、SageMakerセッションの開始、そしてS3へのデータのアップロードが説明されています。

05:00

📈 EDAとデータ前処理、モデルのトレーニング準備

第2段落では、データの可視化、前処理、特徴量エンジニアリング、そしてデータの分割について説明されています。EDA(Exploratory Data Analysis)を通じて、カテゴリーデータの頻度テーブル、数値データのヒストグラム、相関分析が行われ、特徴量エンジニアリングによってダミー変数の作成や相関が高い変数の削除が行われています。さらに、boto3を使用してS3にトレーニングデータ、テストデータ、検証データをアップロードするプロセスが紹介されています。

10:00

🛠 モデルのトレーニングとデプロイ

このセクションでは、SageMakerでモデルのトレーニングとデプロイのプロセスが詳述されています。XGBoostモデルを使用する場合の例として、AWSが提供するイメージURIを通じてモデルを取得し、S3からトレーニングデータと検証データを取り込み、SageMakerのestimatorを使用してモデルを定義しています。ハイパーパラメータの設定、トレーニングの開始、そしてデプロイメントのためのエンドポイントの作成方法が解説されています。

15:02

🔧 モデルのシリアライゼーションとエンドポイントのクリーンアップ

最後のセクションでは、モデルのシリアライゼーションとエンドポイントのクリーンアップについて説明されています。シリアライゼーションは、推論エンドポイントでデータを正しく処理するために必要で、CSVシリアライザを使用することが提案されています。また、モデルのデプロイメント後、エンドポイントの削除が重要で、料金が発生しないようにするために行われています。AWSのハンズオンリンクが提供され、ステップバイステップでモデルを構築、学習、デプロイする方法が学べる場所が紹介されています。

Mindmap

Keywords

💡Amazon SageMaker

Amazon SageMakerは、機械学習モデルのビルド、トレーニング、デプロイを支援するAWSのサービスです。このビデオでは、SageMakerを使用して機械学習モデルを構築する方法についてステップバイステップのプロセスを説明しています。ビデオの主題は、AWS環境での機械学習モデルの開発プロセスです。

💡AWS

AWS(Amazon Web Services)は、クラウドコンピューティングサービスを提供するAmazonの部門です。ビデオではAWS上で機械学習モデルを構築する際に必要なAWS固有の概念とサービスについて触れています。例えば、S3バケット、IAMロール、およびboto3ライブラリなどです。

💡機械学習モデル

機械学習モデルとは、データから学習し予測や判断を行うシステムのことです。ビデオでは、SageMakerを利用して機械学習モデルをトレーニングし、デプロイするプロセスに焦点を当てています。モデルのトレーニングには、データのインポート、EDA(探索的データ分析)、特徴エンジニアリング、そしてモデルのハイパーパラメーター調整などが含まれます。

💡トレーニング

トレーニングは、機械学習においてモデルをデータに適合させるプロセスです。ビデオでは、トレーニングデータとバリデーションデータを使ってXGBoostモデルをトレーニングする方法について説明しています。トレーニングプロセスは、SageMakerのEstimator APIを利用してS3に保存されたデータ上で行われます。

💡デプロイ

デプロイは、トレーニングされた機械学習モデルを実際のアプリケーションやサービスに統合するプロセスです。ビデオでは、SageMakerのデプロイ機能を使ってモデルを簡単にエンドポイントとして公開し、予測リクエストを受け付ける方法を紹介しています。

💡S3バケット

S3バケットは、AWSが提供するストレージサービスで、大量のデータを保存することができます。ビデオでは、S3バケットにデータをアップロードし、トレーニングやテストに使用する方法について説明しています。S3は、データのバックアップや共有に役立ちます。

💡boto3

boto3は、AWSサービスとPythonで通信するためのSDK(ソフトウェア開発キット)です。ビデオでは、boto3を使用してPythonコードがAWSのS3サービスと通信し、データをアップロードまたはダウンロードする例があります。

💡ハイパーパラメーター

ハイパーパラメーターは、モデルのトレーニング前に設定されるパラメーターで、モデルの性能に大きな影響を与えます。ビデオでは、SageMakerのEstimator APIを使ってXGBoostモデルのハイパーパラメーターを調整し、最適なモデルをトレーニングする方法について触れています。

💡データのシリアル化

データのシリアル化とは、データ構造やオブジェクトを文字列やバイトストリームに変換するプロセスです。ビデオでは、モデルの推論エンドポイントでデータをシリアル化し、モデルが受け取れる形式に変換する必要があると説明しています。CSVシリアライザーがその役割を果たしています。

💡予測

予測は、機械学習モデルが新しいデータに対して予測値を生成することを指します。ビデオでは、トレーニングされたモデルを使ってテストデータの予測を行い、結果を評価する方法について説明しています。これは、モデルのパフォーマンスを理解するために重要なステップです。

Highlights

视频将介绍使用Amazon Sagemaker构建、训练和部署机器学习模型的逐步过程。

提醒观众作者有关于AWS和数据科学的播放列表,共六段视频,供复习。

展示了如何在Sagemaker Studio中打开Sagemaker并创建域。

强调了AWS环境中构建模型与本地环境的不同之处。

演示了如何使用wget命令从AWS服务器获取数据。

介绍了如何使用pandas库查看和处理数据。

解释了在Sagemaker中导入数据和设置环境的方法。

讨论了使用boto3库与AWS服务进行交互的重要性。

说明了如何使用Sagemaker会话上传数据到S3存储桶。

展示了如何进行EDA(探索性数据分析)和数据准备。

介绍了特征工程,包括创建虚拟变量和基于分析删除列。

解释了如何使用Numpy的split函数分割训练、验证和测试数据集。

讨论了使用boto3与S3通信并上传训练数据集的过程。

介绍了如何在AWS环境中使用image URIs来获取机器学习模型。

解释了如何定义和训练模型,包括设置实例数量和类型。

展示了如何使用Sagemaker的deploy方法来创建模型端点。

讨论了模型部署后的数据序列化和预测函数的实现。

强调了在模型部署后删除端点以避免产生额外费用的重要性。

提供了一个AWS的实践链接,供观众亲自实践构建、训练和部署模型的过程。

总结了在Sagemaker环境中工作时需要记住的五六个主要事项。

鼓励观众通过点赞和评论来支持更多相关内容的创作。

Transcripts

play00:00

in this video I am going to explain you

play00:02

stepwise process of building training

play00:06

and deploying a machine learning model

play00:07

with Amazon sagemaker okay so this is

play00:11

going to be a technical session guys be

play00:13

ready to pay lot of attention and hence

play00:16

you will learn lot of things in this

play00:17

video before going into the video guys I

play00:20

want to remind you that I have Amazon

play00:22

AWS playlist on and full data science

play00:24

there are six videos in case you want to

play00:27

revise what all we have covered till now

play00:29

okay in the last video I showed what are

play00:33

the important components from Sage maker

play00:35

point of view or machine learning point

play00:37

of view in AWS okay today we are going

play00:40

to see how to build train and deploy our

play00:42

first model let's go ahead and I am into

play00:45

this sagemaker studio guys and I told

play00:48

you in last video how to open sagemaker

play00:50

Studio how to create a domain Etc

play00:52

everything okay the link is right here

play00:55

I'll paste in the description as well

play00:56

you guys can revise if you want

play00:58

now what we will do is I am not going to

play01:02

explain you everything which is General

play01:04

between AWS and normal machine learning

play01:07

okay I am going to explain you things

play01:11

which are very specific to AWS because

play01:14

Normal things more or less you know how

play01:16

to build Trend and deploy a model but

play01:18

how things are different when it's an

play01:20

AWS environment that is what the focus

play01:22

of explanation is going to be okay so

play01:24

let's go ahead and try to see what I'm

play01:26

doing in each step here

play01:28

so four or five steps four steps

play01:30

basically this notebook is divided into

play01:32

first is environment setting and data

play01:35

import that you can see here environment

play01:36

setting and data import okay so what I'm

play01:39

doing here first thing that we will need

play01:41

is

play01:42

data right so data we will need now when

play01:45

you when you build a model in your local

play01:47

environment or when you build a model in

play01:49

in your local computer or any other

play01:51

machine right you may have a CSV file

play01:53

you may connect to a database you may

play01:55

get it from some API Etc here what I am

play01:58

doing is I am getting data from Amazon

play02:00

itself AWS itself okay so AWS has kept

play02:04

some data on some location for example

play02:06

here you can see here Us West S3 US West

play02:09

Amazon AWS then some data is there

play02:12

autopilot direct marketing Bank

play02:14

additional so this is the URL for the

play02:17

data which they have given it for free

play02:19

to use to people for practice purpose

play02:22

learning purpose okay so I need this

play02:24

data how I will get this data

play02:27

I'm just running a simple command here

play02:29

wget wget I want to hit that URL I want

play02:32

to get that file and then I am unzipping

play02:34

that data so first thing first how we

play02:37

are getting the data we are getting the

play02:39

data kept on AWS server through wget

play02:41

what is w gate just a normal command

play02:44

Linux command you can say to get data

play02:46

from some URL okay so once I run this I

play02:49

get the data and I unzip that data now

play02:52

you can see here I have run this

play02:53

notebook already so this is showing like

play02:55

this okay

play02:56

now I am importing pandas and I am just

play02:59

showing you how that data looks like

play03:00

okay so as you can see there are

play03:02

multiple columns age of marital status

play03:04

education default housing contract Etc

play03:07

and towards the end you will see the

play03:09

target column for this data okay

play03:12

this column is your target column the

play03:14

last column y column okay now all these

play03:17

are your independent columns so as I

play03:19

told you we will put focus on only the

play03:20

features which are different between

play03:22

when you build a normal normal thing you

play03:24

do and when I am doing it in Sage maker

play03:26

okay so in Sage maker you have to import

play03:29

Sage maker first okay and then

play03:33

this is a usual practice of opening sage

play03:35

maker session so you say s is equal to

play03:38

Sage maker dot session which means you

play03:40

are opening a sage maker session here

play03:41

you want to perform some activities so

play03:43

you are opening a sales maker session

play03:45

here using this stage maker session what

play03:48

I am doing is I am uploading the data

play03:50

the data which I have just downloaded I

play03:53

am uploading the data to one of the S3

play03:56

location this I am doing to keep a

play03:58

backup of my data for example tomorrow

play04:00

if I want to refer which data I build my

play04:02

model on right so in the first step I

play04:05

extracted the data from some AWS

play04:07

location in this step I am pushing that

play04:09

in a S3 bucket and this is the bucket

play04:12

location where I am pushing that okay

play04:13

and how I am doing that using this

play04:16

upload data so what we have done until

play04:18

now taken and pushed it to the AWS data

play04:22

now let's move ahead guys and one

play04:24

important thing you need to know here is

play04:26

called boto3

play04:27

Moto 3 is something that you don't use

play04:30

outside AWS because this is basically a

play04:33

AWS SDK kind of Library you can think of

play04:36

that makes you enable to work in Python

play04:39

environments and interact with different

play04:40

AWS services so suppose you want to use

play04:43

python in AWS environment you need both

play04:45

two three to interact with multiple

play04:47

Services okay that is the usability of

play04:50

AWS boto3 now you come here and you

play04:53

import something known as execution role

play04:55

and then you say role is equal to

play04:57

execution rule so as you know AWS is a

play05:00

cloud platform so roles and permissions

play05:03

are quite important here okay just pay

play05:06

attention to what all new things we are

play05:08

doing that's all okay you no need to go

play05:10

much deep into model building steps Etc

play05:12

just new things so new thing is Moto 3

play05:15

new thing is role okay

play05:17

let's move ahead all these things are

play05:19

normal packages important apart from

play05:21

sagemaker which I had done before also

play05:23

but let's let it be here okay

play05:26

and then I'm just doing some Eda and

play05:28

data preparation so what I'm doing is

play05:30

I'm doing frequency tables for each

play05:32

categorical feature and then histogram

play05:34

for each numerical features okay

play05:37

so I will not go into much detail of

play05:39

normal python codes okay so these are

play05:42

nothing but you know

play05:45

um seeing the percentages of in my

play05:47

categorical feature which is how many

play05:49

times and

play05:50

some of these you know describe kind of

play05:53

thing and then some of these Scatter

play05:55

Plots Etc okay

play05:57

then I am doing some correlation

play05:59

analysis here very simple python code

play06:01

okay nothing new here also so I will

play06:04

skip this part as well

play06:06

then I am doing some kind of feature

play06:08

engineering here this is normal machine

play06:10

learning stuff so if you can see line

play06:12

one I am just replacing few values with

play06:14

some other values line two also same

play06:17

thing line three I am creating dummy

play06:18

data okay dummy variables so normal

play06:21

machine learning stuff here as well okay

play06:23

then dropping some column based on my

play06:26

analysis of correlation and based on my

play06:28

analysis of scatter plot

play06:30

now this line is important I am breaking

play06:33

Trend validation and test data by doing

play06:35

NP dot split here okay

play06:38

so I am breaking in some proportion here

play06:40

as you can see and we are having now

play06:43

Trend test and validation set here

play06:45

if you go one line down then what we are

play06:48

doing we are preparing our train data

play06:50

okay train data validation data test

play06:52

data and you know predictor and response

play06:56

we are separating okay

play06:57

the next block of line which you are see

play07:00

here which you are seeing here what's

play07:02

happening just pay attention here guys

play07:03

as I told you boto is a package that

play07:06

makes python developer work in AWS

play07:08

environment

play07:10

and enable python code to communicate

play07:12

with various AWS services so here using

play07:16

boto what we are doing is we are talking

play07:18

to S3 so see here boto3 dot session dot

play07:22

resource which resource are we talking

play07:24

to S3 okay

play07:26

then we are saying bucket which bucket I

play07:28

want to talk to I want to talk to

play07:30

sagemaker session dot default bucket

play07:33

okay I have taken one bucket you can

play07:34

give any other bucket as well given this

play07:37

role or whichever user is running this

play07:39

has permission to that bucket or that

play07:41

user whichever role that user has

play07:42

acquired permission is important guys

play07:44

otherwise this will fail okay

play07:46

so default bucket I have taken in this

play07:48

default bucket what I am doing if you

play07:51

see this one line from here to here I am

play07:54

just uploading my train.csv that I

play07:56

prepared in this line in this block so

play07:59

what I am doing in the default bucket

play08:01

using the help of bo23 I am uploading my

play08:03

train data test data validation data and

play08:07

all the data that I want to upload okay

play08:11

now this is two parts of the of this

play08:13

problem is done for example data import

play08:15

is done and Eda and data preparation is

play08:18

also done

play08:20

let's move ahead to the training model

play08:22

part so

play08:24

in training model

play08:26

important things and different things

play08:28

from normal day-to-day work right so

play08:31

normally when you when you want to use

play08:33

let's say XD boost in Python how you

play08:35

will use you will import XE boost

play08:37

package right but in AWS environment AWS

play08:40

has given you many packages in the form

play08:43

of image URI so see these two lines guys

play08:46

carefully here from sagemaker import

play08:48

image underscore Uris and container is

play08:51

equal to imageurize dot retrieve every

play08:53

Boost from this region version whatever

play08:55

you want this line is critical and

play08:57

important here suppose you want to use

play09:00

random Forest suppose you want to use

play09:01

decision tree suppose you want to use

play09:03

some other module okay one way of doing

play09:05

that would be you can get it from python

play09:07

or you can do a independent installation

play09:10

and get it here second way of doing it

play09:13

is directly it's kept in the

play09:15

AWS repository okay how do you get from

play09:18

AWS repositories you can just import

play09:20

image URI and you can import whatever

play09:22

model you want to use like this okay

play09:24

this is important

play09:26

now I want to take train data and I want

play09:30

to take validation data you remember

play09:31

where we had kept these data we had kept

play09:34

in S3 bucket default bucket okay so from

play09:37

this we are importing it now see the

play09:39

difference guys this is the real world

play09:43

process of how you work in a machine

play09:45

learning project right it's not like you

play09:47

will always work in a notebook and you

play09:48

know file is there in the notebook and

play09:50

you are using it you are keeping it at a

play09:52

location and then you are pulling it

play09:54

that's what I am doing here I am pulling

play09:56

the data that I had kept in the bucket

play09:59

okay

play10:00

and what is the way to pull the data

play10:02

sagemaker dot inputs you just say this

play10:04

is my input data that's all okay this is

play10:06

my input data this is my validation data

play10:09

once you do that then this line I had

play10:11

run before as well so no need of this

play10:13

line basically

play10:14

and then

play10:16

sagemaker.estimator dot estimator and

play10:18

here you have to say what is your

play10:20

container container is nothing but HD

play10:22

boost model that we got now okay what is

play10:25

your role if you remember in the

play10:26

beginning we created git execution rule

play10:28

okay instance count how many instances

play10:31

you want to run

play10:32

what type of instance instance means you

play10:34

can think of server or ec2 to keep it

play10:36

very simple

play10:37

output path where you want to store your

play10:40

output sagemaker session if you remember

play10:42

this is the sage maker session that one

play10:44

line I had run in the beginning also

play10:46

okay so this is your defining the model

play10:49

till now you are just defining your

play10:51

model and now you will go here and you

play10:55

will just say these are my initial hyper

play10:58

parameters now go ahead and train the

play11:00

model fgb dot fit at the moment you say

play11:02

xgb dot fit right

play11:05

it will start fitting your model on S3

play11:08

input Trend and validation on S3 input

play11:10

validation now if you can see here I had

play11:13

run this before

play11:14

okay so starting the training job

play11:17

preparing the instance for training

play11:18

downloading input data downloading

play11:19

training image info data is your data

play11:22

training image is your file LG Boost

play11:24

file okay

play11:25

and then it will start running your

play11:27

model so see here and then it took some

play11:30

time when I ran it that is the reason

play11:31

I'm not lively in the live session

play11:33

running it okay and then it says you

play11:36

uploading generated training model so

play11:38

where it will upload you had given a

play11:39

path right then training job completed

play11:42

how much time 98 seconds billable

play11:44

seconds is 98 I have to pay for this 98

play11:46

seconds not a problem

play11:48

and then

play11:49

this line is very important here guys

play11:52

SGP predictor is equal to xgb dot deploy

play11:56

initial instance contents and instance

play11:58

type MLM for x large pay attention here

play12:01

guys

play12:01

how Cloud platform makes your life easy

play12:04

okay now suppose in the in the real

play12:07

world or in your day-to-day job if you

play12:10

want to host a model if you want to

play12:11

create a endpoint for your model right

play12:13

it's a big task for you you have to host

play12:15

it using some API kind of environment or

play12:18

some kind of python web web UI kind of

play12:21

environment

play12:22

right AWS makes it very very simple for

play12:25

you you just call this deploy method

play12:27

okay you just say exhibit or deploy and

play12:30

say on how many instances you want to

play12:31

deploy and what is the instance type you

play12:34

want to deploy on if you say these two

play12:36

things right

play12:37

it will simply create a model endpoint

play12:39

for you so create model with name this

play12:42

create endpoint with name this and

play12:43

create endpoint with name this so it

play12:46

will just create endpoint for you now

play12:48

this model is ready for consumption okay

play12:50

but before that there are few more

play12:52

things we have to do the serialization

play12:55

for the for our model okay so what is

play12:58

serializer it's a very simple concept I

play13:00

have opened here this also

play13:05

so Implement methods for serializing

play13:08

data for an inference endpoint so

play13:10

whenever you send your data for

play13:11

prediction right that needs to be

play13:13

serialized and that is what will happen

play13:16

here okay CSV serializer will work here

play13:19

because our data is in CSV form if you

play13:21

remember okay

play13:23

now I am defining a predict function

play13:25

here and just simply calling this

play13:28

predict function with our test data okay

play13:31

test data was created here if you

play13:33

remember guys test data was created here

play13:35

when we were breaking intest and Trend

play13:37

right so here if you see we had written

play13:40

it to to a S3 bucket list or CSV okay

play13:43

and what we are doing here we are simply

play13:46

saying run this predict function on that

play13:48

data okay

play13:50

on the test data and then we will take

play13:53

this and we will do the prediction PD

play13:56

dot cross step confusion Matrix all

play13:58

these things you know already once

play14:00

everything is done then just to just to

play14:02

ensure that we do not keep that endpoint

play14:04

running otherwise uh you know money will

play14:07

be going because that endpoint is

play14:09

running right so delete the endpoint is

play14:11

a good practice

play14:12

so in this entire process guys there are

play14:15

five six main things that you have to

play14:17

remember let me summarize you okay as I

play14:20

am telling you again and again don't

play14:22

bother about what is this model and how

play14:23

model is working Etc I did not explain

play14:25

knowingly those things remember

play14:28

when you are working in stage maker kind

play14:30

of environment it's always good to keep

play14:32

your data in S3 or some of the AWS

play14:35

storage okay various types of AWS

play14:38

storage are there which I have a video

play14:40

in that playlist you can watch that

play14:42

second thing that you have to you have

play14:44

to keep in mind is you will need Sage

play14:45

makers and then session you need to open

play14:48

you need to keep in mind you will use

play14:50

boto package whenever in Python you are

play14:52

interacting with any of the AWS Services

play14:54

okay you need to keep in mind that

play14:58

leave these machine learning things you

play15:00

need to keep in mind that always keep

play15:02

taking a backup of your data in S3 S3 is

play15:05

a cheap storage so in S3 okay then you

play15:08

no need to import from pandas or

play15:10

somewhere if you want to use any

play15:11

packages something you will get that in

play15:13

AWS Itself by using image URI okay you

play15:17

can hyper you can tune your models very

play15:19

simply here you can deploy your model by

play15:21

just calling dot deploy function and

play15:24

it's very easy to create an endpoint

play15:26

here and your model is live now my model

play15:28

is live okay I want to create an API for

play15:31

this I want to connect it to a third

play15:33

party system all these things are doable

play15:35

in just few lines of code okay

play15:38

now you will also want to practice this

play15:42

so let me give you a very good link

play15:43

where you can go and do all these things

play15:46

that I have done here okay

play15:48

so go to here this this link I will

play15:50

paste in the description AWS amazon.com

play15:53

Hands-On build train and deploy uh Sage

play15:57

maker okay

play15:58

so come here and you will see all the

play16:00

steps that I ran just now

play16:02

and step by step create a notebook

play16:04

instance okay and then prepare your data

play16:08

then what are the code will be also

play16:11

there you can copy it and run it and if

play16:13

you go all the way till deletion of the

play16:15

end point see cleanup it is telling to

play16:18

clean that

play16:19

the last step okay clean that model

play16:21

endpoint otherwise you may be charged it

play16:24

is also deleting the buckets where we

play16:26

stored our data or intermediary files

play16:28

just to be on the safer side so that

play16:30

there is no charge okay I will give you

play16:32

this link if you are into data science

play16:34

if you have to do anything with machine

play16:36

learning ensure you get your hands dirty

play16:39

in sagemaker okay you might get

play16:41

frustrated because things are little

play16:43

different than how we learn day-to-day

play16:45

machine learning but remember guys this

play16:47

is worth giving your time okay I will

play16:50

come up with more videos on AWS but

play16:52

first ensure you learn everything up to

play16:54

here so now there will be seven videos

play16:56

in this series okay first is basic

play16:58

secondary stored is third is Computing

play17:00

fourth is application deployment fifth

play17:02

is CLI sixth is stage maker introduction

play17:05

and including this this is building

play17:07

training and deploying a sage machine

play17:09

learning model in sales maker okay so

play17:11

just be clear up to here and I am very

play17:14

soon coming up with more videos please

play17:16

give me a thumbs up guys if you like

play17:18

this content I will create more content

play17:19

if you guys give me good comments and

play17:21

likes see you all in the next video

play17:23

wherever you are stay safe and take care

Rate This

5.0 / 5 (0 votes)

Related Tags
AWSSageMaker機械学習モデル構築トレーニング展開データサイエンスクラウドAPIデプロイエンドポイント
Do you need a summary in English?