import%20marimo%0A%0A__generated_with%20%3D%20%220.16.0%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20pandas%20as%20pd%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20seaborn%20as%20sns%0A%20%20%20%20return%20(mo%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%20Module%205%3A%20%5BDeployment%5D(https%3A%2F%2Fgithub.com%2FDataTalksClub%2Fmachine-learning-zoomcamp%2Ftree%2Fmaster%2F05-deployment)%0A%0A%20%20%20%20%3E%20Note%3A%20sometimes%20your%20answer%20doesn't%20match%20one%20of%20the%20options%20exactly.%20%0A%20%20%20%20%3E%20That's%20fine.%20%0A%20%20%20%20%3E%20Select%20the%20option%20that's%20closest%20to%20your%20solution.%0A%20%20%20%20%3E%20If%20it's%20exactly%20in%20between%20two%20options%2C%20select%20the%20higher%20value.%0A%0A%20%20%20%20We%20recommend%20using%20python%203.12%20or%203.13%20in%20this%20homework.%0A%0A%20%20%20%20In%20this%20homework%2C%20we're%20going%20to%20continue%20working%20with%20the%20lead%20scoring%20dataset.%20You%20don't%20need%20the%20dataset%3A%20we%20will%20provide%20the%20model%20for%20you.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Question%201%0A%0A%20%20%20%20*%20Install%20%60uv0.7.12%60%0A%20%20%20%20*%20What's%20the%20version%20of%20uv%20you%20installed%3F%0A%20%20%20%20*%20Use%20%60--version%60%20to%20find%20out%0A%0A%0A%20%20%20%20%23%23%20Initialize%20an%20empty%20uv%20project%0A%0A%20%20%20%20You%20should%20create%20an%20empty%20folder%20for%20homework%0A%20%20%20%20and%20do%20it%20there.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Answer%0A%0A%20%20%20%20First%2C%20%60uv%60%20was%20installed%20following%20the%20official%20installation%20instructions%3A%0A%0A%20%20%20%20%60%60%60%0A%20%20%20%20curl%20-LsSf%20https%3A%2F%2Fastral.sh%2Fuv%2Finstall.sh%20%7C%20sh%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20The%2C%20with%20%60uv%20--version%60%20we%20found%20that%20we%20are%20using%20**0.7.12**.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Question%202%0A%0A%20%20%20%20*%20Use%20uv%20to%20install%20Scikit-Learn%20version%201.6.1%0A%20%20%20%20*%20What's%20the%20first%20hash%20for%20Scikit-Learn%20you%20get%20in%20the%20lock%20file%3F%0A%20%20%20%20*%20Include%20the%20entire%20string%20starting%20with%20sha256%3A%2C%20don't%20include%20quotes%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Answer%0A%0A%20%20%20%20The%20%60scikit-learn%60%20module%20was%20installed%20with%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20uv%20init%0A%20%20%20%20uv%20add%20scikit-learn%3D%3D1.6.1%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20The%20first%20has%20hound%20was%20the%20one%20that%20corresponds%20with%20**joblib**%3A%0A%0A%20%20%20%20%60%60%60%0A%20%20%20%20%5B%5Bpackage%5D%5D%0A%20%20%20%20name%20%3D%20%22joblib%22%0A%20%20%20%20version%20%3D%20%221.5.2%22%0A%20%20%20%20source%20%3D%20%7B%20registry%20%3D%20%22https%3A%2F%2Fpypi.org%2Fsimple%22%20%7D%0A%20%20%20%20sdist%20%3D%20%7B%20url%20%3D%20%22https%3A%2F%2Ffiles.pythonhosted.org%2Fpackages%2Fe8%2F5d%2F447af5ea094b9e4c4054f82e223ada074c552335b9b4b2d14bd9b35a67c4%2Fjoblib-1.5.2.tar.gz%22%2C%20hash%20%3D%20%22sha256%3A3faa5c39054b2f03ca547da9b2f52fde67c06240c31853f306aea97f13647b55%22%2C%20size%20%3D%20331077%2C%20upload-time%20%3D%20%222025-08-27T12%3A15%3A46.575Z%22%20%7D%0A%20%20%20%20wheels%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%7B%20url%20%3D%20%22https%3A%2F%2Ffiles.pythonhosted.org%2Fpackages%2F1e%2Fe8%2F685f47e0d754320684db4425a0967f7d3fa70126bffd76110b7009a0090f%2Fjoblib-1.5.2-py3-none-any.whl%22%2C%20hash%20%3D%20%22sha256%3A4e1f0bdbb987e6d843c70cf43714cb276623def372df3c22fe5266b2670bc241%22%2C%20size%20%3D%20308396%2C%20upload-time%20%3D%20%222025-08-27T12%3A15%3A45.188Z%22%20%7D%2C%0A%20%20%20%20%5D%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20In%20other%20words%2C%20this%20was%20the%20first%20hash%3A%0A%0A%20%20%20%20%60%60%60%0A%20%20%20%20sha256%3A3faa5c39054b2f03ca547da9b2f52fde67c06240c31853f306aea97f13647b55%0A%20%20%20%20%60%60%60%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Models%0A%0A%20%20%20%20We%20have%20prepared%20a%20pipeline%20with%20a%20dictionary%20vectorizer%20and%20a%20model.%0A%0A%20%20%20%20It%20was%20trained%20(roughly)%20using%20this%20code%3A%0A%0A%20%20%20%20%60%60%60python%0A%20%20%20%20categorical%20%3D%20%5B'lead_source'%5D%0A%20%20%20%20numeric%20%3D%20%5B'number_of_courses_viewed'%2C%20'annual_income'%5D%0A%0A%20%20%20%20df%5Bcategorical%5D%20%3D%20df%5Bcategorical%5D.fillna('NA')%0A%20%20%20%20df%5Bnumeric%5D%20%3D%20df%5Bnumeric%5D.fillna(0)%0A%0A%20%20%20%20train_dict%20%3D%20df%5Bcategorical%20%2B%20numeric%5D.to_dict(orient%3D'records')%0A%0A%20%20%20%20pipeline%20%3D%20make_pipeline(%0A%20%20%20%20%20%20%20%20DictVectorizer()%2C%0A%20%20%20%20%20%20%20%20LogisticRegression(solver%3D'liblinear')%0A%20%20%20%20)%0A%0A%20%20%20%20pipeline.fit(train_dict%2C%20y_train)%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20%3E%20**Note**%3A%20You%20don't%20need%20to%20train%20the%20model.%20This%20code%20is%20just%20for%20your%20reference.%0A%0A%20%20%20%20And%20then%20saved%20with%20Pickle.%20Download%20it%20%5Bhere%5D(https%3A%2F%2Fgithub.com%2FDataTalksClub%2Fmachine-learning-zoomcamp%2Ftree%2Fmaster%2Fcohorts%2F2025%2F05-deployment%2Fpipeline_v1.bin).%0A%0A%20%20%20%20With%20%60wget%60%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20wget%20https%3A%2F%2Fgithub.com%2FDataTalksClub%2Fmachine-learning-zoomcamp%2Fraw%2Frefs%2Fheads%2Fmaster%2Fcohorts%2F2025%2F05-deployment%2Fpipeline_v1.bin%0A%20%20%20%20%60%60%60%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Question%203%0A%0A%20%20%20%20Let's%20use%20the%20model!%0A%0A%20%20%20%20*%20Write%20a%20script%20for%20loading%20the%20pipeline%20with%20pickle%0A%20%20%20%20*%20Score%20this%20record%3A%0A%0A%20%20%20%20%60%60%60json%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22lead_source%22%3A%20%22paid_ads%22%2C%0A%20%20%20%20%20%20%20%20%22number_of_courses_viewed%22%3A%202%2C%0A%20%20%20%20%20%20%20%20%22annual_income%22%3A%2079276.0%0A%20%20%20%20%7D%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20If%20you're%20getting%20errors%20when%20unpickling%20the%20files%2C%20check%20their%20checksum%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20%24%20md5sum%20pipeline_v1.bin%0A%20%20%20%207d17d2e4dfbaf1e408e1a62e6e880d49%20*pipeline_v1.bin%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20What's%20the%20probability%20that%20this%20lead%20will%20convert%3F%20%0A%0A%20%20%20%20*%200.333%0A%20%20%20%20*%200.533%0A%20%20%20%20*%200.733%0A%20%20%20%20*%200.933%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Answer%0A%0A%20%20%20%20With%20this%20code%3A%0A%0A%20%20%20%20%60%60%60python%0A%20%20%20%20import%20pickle%0A%0A%20%20%20%20with%20open(%22pipeline_v1.bin%22%2C%20%22rb%22)%20as%20f%3A%0A%20%20%20%20%20%20%20%20dict_vectorizer%2C%20model%20%3D%20pickle.load(f)%0A%0A%20%20%20%20record%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22lead_source%22%3A%20%22paid_ads%22%2C%0A%20%20%20%20%20%20%20%20%22number_of_courses_viewed%22%3A%202%2C%0A%20%20%20%20%20%20%20%20%22annual_income%22%3A%2079276.0%0A%20%20%20%20%7D%0A%0A%20%20%20%20x%20%3D%20dict_vectorizer.transform(record)%0A%0A%20%20%20%20model.predict_proba(x)%5B%3A%2C%201%5D%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20We%20obtain%20a%20prediction%20of%20a%20probability%20of%20**0.533**.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Question%204%0A%0A%20%20%20%20Now%20let's%20serve%20this%20model%20as%20a%20web%20service%0A%0A%20%20%20%20*%20Install%20FastAPI%0A%20%20%20%20*%20Write%20FastAPI%20code%20for%20serving%20the%20model%0A%20%20%20%20*%20Now%20score%20this%20client%20using%20%60requests%60%3A%0A%0A%20%20%20%20%60%60%60python%0A%20%20%20%20url%20%3D%20%22YOUR_URL%22%0A%20%20%20%20client%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22lead_source%22%3A%20%22organic_search%22%2C%0A%20%20%20%20%20%20%20%20%22number_of_courses_viewed%22%3A%204%2C%0A%20%20%20%20%20%20%20%20%22annual_income%22%3A%2080304.0%0A%20%20%20%20%7D%0A%20%20%20%20requests.post(url%2C%20json%3Dclient).json()%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20What's%20the%20probability%20that%20this%20client%20will%20get%20a%20subscription%3F%0A%0A%20%20%20%20*%200.334%0A%20%20%20%20*%200.534%0A%20%20%20%20*%200.734%0A%20%20%20%20*%200.934%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Answer%0A%0A%20%20%20%20A%20project%20with%20these%20dependencies%20was%20created%3A%0A%0A%20%20%20%20%60%60%60toml%0A%20%20%20%20dependencies%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%22fastapi%5Bstandard%5D%3E%3D0.120.0%22%2C%0A%20%20%20%20%20%20%20%20%22scikit-learn%3D%3D1.6.1%22%2C%0A%20%20%20%20%5D%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20Then%2C%20to%20set%20up%20our%20FastAPI%20server%2C%20this%20code%20was%20used%3A%0A%0A%20%20%20%20%60%60%60python%0A%20%20%20%20import%20pickle%0A%20%20%20%20from%20fastapi%20import%20FastAPI%0A%20%20%20%20from%20pydantic%20import%20BaseModel%0A%0A%20%20%20%20class%20Client(BaseModel)%3A%0A%20%20%20%20%20%20%20%20lead_source%3A%20str%0A%20%20%20%20%20%20%20%20number_of_courses_viewed%3A%20int%0A%20%20%20%20%20%20%20%20annual_income%3A%20float%0A%0A%20%20%20%20with%20open(%22pipeline_v1.bin%22%2C%20%22rb%22)%20as%20f%3A%0A%20%20%20%20%20%20%20%20dict_vectorizer%2C%20model%20%3D%20pickle.load(f)%0A%0A%20%20%20%20app%20%3D%20FastAPI()%0A%0A%20%20%20%20%40app.post(%22%2Fpredict%22)%0A%20%20%20%20def%20predict(client%3A%20Client)%3A%0A%20%20%20%20%20%20%20%20x%20%3D%20dict_vectorizer.transform(client.model_dump())%0A%0A%20%20%20%20%20%20%20%20return%20model.predict_proba(x)%5B%3A%2C%201%5D%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20The%20server%20was%20started%20by%20running%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20uv%20run%20fastapi%20dev%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20With%20the%20code%20provided%20above%2C%20we%20obtained%20**0.534**.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Docker%0A%0A%20%20%20%20Install%20%5BDocker%5D(https%3A%2F%2Fgithub.com%2FDataTalksClub%2Fmachine-learning-zoomcamp%2Fblob%2Fmaster%2F05-deployment%2F06-docker.md).%20%0A%20%20%20%20We%20will%20use%20it%20for%20the%20next%20two%20questions.%0A%0A%20%20%20%20For%20these%20questions%2C%20we%20prepared%20a%20base%20image%3A%20%60agrigorev%2Fzoomcamp-model%3A2025%60.%20%0A%20%20%20%20You'll%20need%20to%20use%20it%20(see%20Question%205%20for%20an%20example).%0A%0A%20%20%20%20This%20image%20is%20based%20on%20%603.13.5-slim-bookworm%60%20and%20has%0A%20%20%20%20a%20pipeline%20with%20logistic%20regression%20(a%20different%20one)%0A%20%20%20%20as%20well%20a%20dictionary%20vectorizer%20inside.%20%0A%0A%20%20%20%20This%20is%20how%20the%20Dockerfile%20for%20this%20image%20looks%20like%3A%0A%0A%20%20%20%20%60%60%60docker%20%0A%20%20%20%20FROM%20python%3A3.13.5-slim-bookworm%0A%20%20%20%20WORKDIR%20%2Fcode%0A%20%20%20%20COPY%20pipeline_v2.bin%20.%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20We%20already%20built%20it%20and%20then%20pushed%20it%20to%20%5B%60agrigorev%2Fzoomcamp-model%3A2025%60%5D(https%3A%2F%2Fhub.docker.com%2Fr%2Fagrigorev%2Fzoomcamp-model).%0A%0A%20%20%20%20%3E%20**Note**%3A%20You%20don't%20need%20to%20build%20this%20docker%20image%2C%20it's%20just%20for%20your%20reference.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Question%205%0A%0A%20%20%20%20Download%20the%20base%20image%20%60agrigorev%2Fzoomcamp-model%3A2025%60.%20You%20can%20easily%20make%20it%20by%20using%20%5Bdocker%20pull%5D(https%3A%2F%2Fdocs.docker.com%2Fengine%2Freference%2Fcommandline%2Fpull%2F)%20command.%0A%0A%20%20%20%20So%20what's%20the%20size%20of%20this%20base%20image%3F%0A%0A%20%20%20%20*%2045%20MB%0A%20%20%20%20*%20121%20MB%0A%20%20%20%20*%20245%20MB%0A%20%20%20%20*%20330%20MB%0A%0A%20%20%20%20You%20can%20get%20this%20information%20when%20running%20%60docker%20images%60%20-%20it'll%20be%20in%20the%20%22SIZE%22%20column.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Answer%0A%0A%20%20%20%20These%20commands%20were%20used%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20docker%20pull%20agrigorev%2Fzoomcamp-model%3A2025%0A%20%20%20%20docker%20images%20%7C%20grep%20%22agrigorev%2Fzoomcamp-model%22%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20...%20to%20check%20that%20the%20size%20of%20the%20image%20is%20**121MB**.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Dockerfile%0A%0A%20%20%20%20Now%20create%20your%20own%20%60Dockerfile%60%20based%20on%20the%20image%20we%20prepared.%0A%0A%20%20%20%20It%20should%20start%20like%20that%3A%0A%0A%20%20%20%20%60%60%60docker%0A%20%20%20%20FROM%20agrigorev%2Fzoomcamp-model%3A2025%0A%20%20%20%20%23%20add%20your%20stuff%20here%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20Now%20complete%20it%3A%0A%0A%20%20%20%20*%20Install%20all%20the%20dependencies%20from%20pyproject.toml%0A%20%20%20%20*%20Copy%20your%20FastAPI%20script%0A%20%20%20%20*%20Run%20it%20with%20uvicorn%20%0A%0A%20%20%20%20After%20that%2C%20you%20can%20build%20your%20docker%20image.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Answer%0A%0A%20%20%20%20We%20build%20this%20image%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20FROM%20agrigorev%2Fzoomcamp-model%3A2025%0A%0A%20%20%20%20WORKDIR%20%2Fcode%0A%0A%20%20%20%20COPY%20--from%3Dghcr.io%2Fastral-sh%2Fuv%3Alatest%20%2Fuv%20%2Fuvx%20%2Fbin%2F%0A%20%20%20%20COPY%20%5B%22main.py%22%2C%20%22pipeline_v1.bin%22%2C%20%22pyproject.toml%22%2C%20%22uv.lock%22%2C%20%22.%2F%22%5D%0A%0A%20%20%20%20RUN%20uv%20sync%20--frozen%20--no-cache%0A%0A%20%20%20%20EXPOSE%208001%0A%20%20%20%20CMD%20%5B%22uv%22%2C%20%22run%22%2C%20%22uvicorn%22%2C%20%22main%3Aapp%22%2C%20%22--host%22%2C%20%220.0.0.0%22%2C%20%22--port%22%2C%20%228001%22%5D%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20and%20then%20we%20built%20it%20and%20run%20it%20with%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20docker%20build%20-t%20ml-homework%20.%0A%20%20%20%20docker%20run%20-p%208001%3A8001%20-it%20--rm%20ml-homework%0A%20%20%20%20%60%60%60%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Question%206%0A%0A%20%20%20%20Let's%20run%20your%20docker%20container!%0A%0A%20%20%20%20After%20running%20it%2C%20score%20this%20client%20once%20again%3A%0A%0A%20%20%20%20%60%60%60python%0A%20%20%20%20url%20%3D%20%22YOUR_URL%22%0A%20%20%20%20client%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22lead_source%22%3A%20%22organic_search%22%2C%0A%20%20%20%20%20%20%20%20%22number_of_courses_viewed%22%3A%204%2C%0A%20%20%20%20%20%20%20%20%22annual_income%22%3A%2080304.0%0A%20%20%20%20%7D%0A%20%20%20%20requests.post(url%2C%20json%3Dclient).json()%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20What's%20the%20probability%20that%20this%20lead%20will%20convert%3F%0A%0A%20%20%20%20*%200.39%0A%20%20%20%20*%200.59%0A%20%20%20%20*%200.79%0A%20%20%20%20*%200.99%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Answer%0A%0A%20%20%20%20Similar%20to%20what%20we%20obtained%20in%20question%204%20(as%20we%20are%20working%20with%20the%20same%20model%20and%20we%20used%20the%20same%20input)%20we%20obtained%20a%20churn%20estimated%20probability%20of%3A%20**0.534**.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Submit%20the%20results%0A%0A%20%20%20%20*%20Submit%20your%20results%20here%3A%20https%3A%2F%2Fcourses.datatalks.club%2Fml-zoomcamp-2025%2Fhomework%2Fhw05%0A%20%20%20%20*%20If%20your%20answer%20doesn't%20match%20options%20exactly%2C%20select%20the%20closest%20one.%20If%20the%20answer%20is%20exactly%20in%20between%20two%20options%2C%20select%20the%20higher%20value.%0A%0A%0A%0A%20%20%20%20%23%23%20Publishing%20to%20Docker%20hub%0A%0A%20%20%20%20This%20is%20just%20for%20reference%2C%20this%20is%20how%20we%20published%20an%20image%20to%20Docker%20hub.%0A%0A%20%20%20%20%60Dockerfile_base%60%3A%20%0A%0A%20%20%20%20%60%60%60dockerfile%0A%20%20%20%20FROM%20python%3A3.13.5-slim-bookworm%0A%20%20%20%20WORKDIR%20%2Fcode%0A%20%20%20%20COPY%20pipeline_v2.bin%20.%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20Publishing%3A%0A%0A%20%20%20%20%60%60%60bash%0A%20%20%20%20docker%20build%20-t%20mlzoomcamp2025_hw5%20-f%20Dockerfile_base%20.%0A%20%20%20%20docker%20tag%20mlzoomcamp2025_hw5%3Alatest%20agrigorev%2Fzoomcamp-model%3A2025%0A%20%20%20%20docker%20push%20agrigorev%2Fzoomcamp-model%3A2025%0A%20%20%20%20%60%60%60%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
3cd4d71cdfe13bd8338a094585ad52e1148ccdcdbfdeae64392494e378a8d482