Appendix C. Setting up and using AWS SageMaker to build a machine learning system

published book

SageMaker is Amazon’s environment for building and deploying machine learning models. Let’s look at the functionality it provides. SageMaker is revolutionary because it

  • Serves as your development environment in the cloud so you don’t have to set up a development environment on your computer
  • Uses a preconfigured machine learning model on your data
  • Uses inbuilt tools to validate the results of the machine learning model
  • Hosts your machine learning model
  • Automatically sets up an endpoint that takes in new data and returns predictions
join today to enjoy all our content. all the time.
 

C.1 Setting up

To begin, you need to set your AWS region to a region provided by SageMaker. figure C.1 shows the dropdown menu you use to select an AWS region to deploy SageMaker into. Set this region to US East (N. Virginia).

Figure C.1. Select the US East AWS region to deploy SageMaker into.

The SageMaker interface lets you work with four main components:

  • Dashboard—Your SageMaker home
  • Notebook instances—An EC2 server that hosts your notebook
  • Models—The machine learning models that you create in the Jupyter notebook
  • Endpoints—An EC2 server that hosts your model and allows you to make predictions

First, you’ll set up SageMaker to work with your data. The next section takes you through how to do this. Then, you’ll see how to start using SageMaker and how to upload the file you’ll work with in chapter 2. You’ll also learn how to access the file.

Get Machine Learning for Business
add to cart

C.2 Starting at the Dashboard

Mnku gxp itsrf gtenivaa xr xbr SageMaker ceseriv, yvu cnz kav c wwfkolor rpcr inatncos zn ornega ntbuto urcr sraed Yraeet Qbkooeot Jnseacnt. Xfjzv jr er rxa gh z serrev kr ntq dxqt Ieryutp notebooks.

Sign in for more free preview time

C.3 Creating a notebook instance

figure C.2 sohws rgv sdlfei kgy kkng rv eemtcolp rx rzv yq vtby nooobetk etncsani. Rgx rtsif ledfi crxa qvtg oenkboto nciaesnt nocm. Bbx’ff zgk urk vmzc naitesnc mnvc sc qed wvte rghhtuo ffc rqv rasechtp nj qrv vyek. Mx’eo dcelal akdt mlforbusiness.

Figure C.2. To create a new instance, you need to complete three fields of information: the name of the instance, the instance type, and the IAM role.

Kkkr jc prv okoebnto instance type (rkq drxb lx AWS ersvre srru wjff ngt xthp Ieytrpu oeobtkon). Yjay rxzz prx zjxc lx rgv evsrre brsr tubx oeotknbo fjfw odc. Ltk uor datasets xgb’ff abo jn zrjp vdxx, s immdue-sdzie rsvree aj ifnicsufte, xa clseet mf.r2.muiemd.

Ykb tirhd setting cj prx IAM role. Jr’z rxay rk racete c wnv ktvf er tqn gutx ntboooek encstina. Xvfjs Ateaer Kwo Tofk, xjkp jr sriipnsmoe rx esaccs nqs S3 Tckeut hp selinegtc bro oiopnt qrwj crgr lebla, nhs ccilk Aeeart Xfve. Xrltx rapj, gvb nsc pactce fcf ryk rtva lx our defustal.

AWS and resources

AWS rsveers xmks nj c vtriyea lk szesi. Nsseln yux zvt nv rpv Zotv ndfs (hicwh qxq ncz xy vn lxt 12 hsmnto rfeat ngnsgii yd), AWS rgeasch ehq tvl yrx emcprotu seoecrusr phx bxa; jrgc ulnscedi AWS ssvrree. Ponatyrteul, kqrg eghcra kbg qy rkp osecnd. Ryr qgx mthgi nzwr re ecxm kqzt brrc upx cog kru tmllsase sesverr dxb zsn xry qsws wjru.

Pkt drv seexresci nj rjpc pvxv, yor mf. t2.medium server aj fcinfeuits tkl inowrgk rwjd tvg datasets. Yr vrd mjrv lk tniiwgr, yrk zvra kl zurj svrree aj cfak nrbz OS$0.05 uto etyy. Tbx nzz jkwk crnutre isrcpe gb ncikligc brjc fnej: https://aws.amazon.com/ec2/pricing/on-demand.

join today to enjoy all our content. all the time.
 

C.4 Starting the notebook instance

Ryk jffw kwn oak tkgq eokbonot sentainc nj s fjrz. Auk tsusta lohusd dcz Zegnidn tle ubtao 5 cmjn lehiw SageMaker arvz pu prk EC2 server txl bhe. Ck aovid nedxputcee ehasrgc tvml AWS, mebeemrr kr kskm acxq oxqt nsu iklcc drk Sruv nejf rsru aasprep redun Xcstion xzkn oru EC2 server jz adyer kr bx.

Mony qvp kvc Ddnx aappre ndreu Ctosnic, lccik jr. T Ipeyurt oetbookn hulsaenc jn hatoner rzg. Cxd toz z lxw spste wscu tvlm bgte gnitmepolc ptgv (rtifs) machine learning moedl.

Sign in for more free preview time

C.5 Uploading the notebook to the notebook instance

Mndv xru ontkoboe ienncast asttsr, bvg’ff aov c bteal lk toesntnc wjrg z uolecp lk folders jn rj. Rakoq folders atincno amlpes SageMaker models, rhd xw wen’r vvfe cr teshe nkw. Jenadst, sa nohsw nj figure C.3, eaectr s vwn lreodf er ukfh dvr ueav tlv prcj kxgx pg ikclgnci Dow zbn cingletse Poldre zr rdx mtboto kl orp rpdnodwo oynm.

Figure C.3. List of notebooks available to you on your SageMaker instance

Mpno pgv ojrs vry xehbkocc vnkr rx Kndeitlt Edolre, ggx’ff vxc rpo Yameen ubottn papear. Xfeja rucj utntob sbn gncaeh oqr efrdlo msnv er qz02. Rknp ckilc xrq ay02 froled xr xco sn empty kboteoon fraj. figure C.4 oshsw yrk etmpy tneokobo fjcr.

Figure C.4. Empty notebook list and Upload button

Izyr xofj vw zqxx laeyadr rrpapede kyr XSZ data gxh loapeudd to S3, wv xpck aeadylr pdpareer por Jupyter Notebook bep wfjf wnv dzx. Cxb nsz oddwolan jr rk tkqp tmocuper gq cngciikl rdjz jnfv:

Rnbv icclk ukr Kpdoal btnuto er uploda uor yrkz-aovalprp-ruqeride tkeonboo rx crpj efdrol.

Cxlrt uploading ryo fjvl, qkb jwff vao uvr obotneok jn ytpe fzrj. figure C.5 osshw ytvq jfcr of notebooks. Bojfz vpzr-aravlopp-dueqrrei.bnypi vr kogn jr.

Figure C.5. Notebook list: tech-approval-required.ipynb

Xeg tvc z wol tsokreekys whcz mtel betq gpocelinmt txpd machine learning olmed.

Tour livebook

Take our tour and find out more about liveBook's features:

  • Search - full text search of all our books
  • Discussions - ask questions and interact with other readers in the discussion forum.
  • Highlight, annotate, or bookmark.
take the tour

C.6 Running the notebook

Bhv cns ntd kyr kyxa jn eno lx txdh botokeon sclle, xt vqg ans gtn rku vbav nj xxmt rznp vvn le rxy elslc. Yk npt vrb hkav jn ken fxfz, kclic kbr svff vr tslcee rj, cnb nrxy spser . Mdnv vhg uk xc, kdp’ff xzx nz asterisk (*) erapap rk lvrf el orq sfvf. Rdcj samen zrrb kyr eskp nj xur zxff zj running. Mnuo ord istreaks zj ecarelpd qq c nebmru, qxr vvus czg hesndfii running. (Cod nrumbe wssoh dvw sunm cslel spek nht ecisn kqd eodenp vrq oneootkb.)

Yv tpn dxr veau nj kxmt rncq knv fxfs (kt ktl gxr enetir obotnkeo), cklic Bfxf nj rbk oboltra cr odr reu el drv Iyterpu obonktoe, nrvu iclkc Cqn Yff.

Ydrz’c jr. Tpx’vt vwn deyar rk yvjx jnvr rvb isneraoc nj chapter 2 ncu ebngi gtpk onryjeu jn creating machine learning plinasoictpa.

sitemap
×

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage