The next part is also divided into two parts. First I give a brief introduction to decision trees, how a decision tree look like. The last section is about how to train a decision tree. The second part will be about overfitting a decision tree and how to control the size of a tree. DecisionContinue reading “ML Zoomcamp 2023 – Decision Trees and Ensemble Learning– Part 4”
Author Archives: Peter
ML Zoomcamp 2023 – Decision Trees and Ensemble Learning– Part 3
Building upon the necessary preparation steps outlined in the previous article, this section is dedicated to two critical processes: re-encoding categorical variables and performing the train/validation/test split, a crucial step in preparing our data for modeling and evaluation. Data cleaning and preparation – Data Transformation and Splitting – Part 2/2 Re-encoding the categorical variables ToContinue reading “ML Zoomcamp 2023 – Decision Trees and Ensemble Learning– Part 3”
ML Zoomcamp 2023 – Decision Trees and Ensemble Learning– Part 2
In part 1 of this chapter, “Decision Trees and Ensemble Learning,” we introduced the project, which is a binary classification problem aimed at predicting the probability of a client defaulting on a loan. Part 2 of this chapter is divided into two main sections. Preparation Steps In the first part, we focus on necessary preparationContinue reading “ML Zoomcamp 2023 – Decision Trees and Ensemble Learning– Part 2”
ML Zoomcamp 2023 – Decision Trees and Ensemble Learning– Part 1
Credit Risk Scoring Project The project for this week involves credit risk scoring. Imagine you want to buy a mobile phone, so you visit your bank to apply for a loan. You fill out an application form that requests various details, such as your income, the price of the phone, and the loan amount youContinue reading “ML Zoomcamp 2023 – Decision Trees and Ensemble Learning– Part 1”
ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 7
Deployment to the cloud: AWS Elastic Beanstalk This article covers the deployment of the Docker container to the cloud. In the previous article we built a Docker image, build the container, put our churn prediction service there and also the model. Then we build this image and learn how to run it locally. Now weContinue reading “ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 7”
ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 6
Environment management: Docker Why do we need Docker? Docker is a powerful tool that addresses many challenges in modern software development and deployment. It allows us to isolate entire applications from the rest of the system’s processes and dependencies, providing a level of encapsulation and portability that is invaluable in today’s computing landscape. One ofContinue reading “ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 6”
ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 5
Python virtual environment: Pipenv Dependency and environment management When you run ‘pip install scikit-learn,’ it searches in the directories listed in the $PATH variable, such as ~/anaconda3/bin/ in this case. Inside this folder, you have ‘pip,’ ‘python,’ and other packages. The ‘pip’ from this folder is used, and it connects to the Python Package IndexContinue reading “ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 5”
ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 4
Serving the churn model with Flask Now we want to serve the churn model with Flask. Wrapping the predict script into a Flask app First, we need to convert all the code from Jupyter Notebook into .py scripts. The following snippet displays the code for “train.py”. The prediction section is separated from the training partContinue reading “ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 4”
ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 3
Introduction to Flask A web service is a method for communicating between two devices over a network. So let’s say we have our web service and a user who wants to make a request. So the user sends the request with some information. The request has some parameters, then the user gets back result withContinue reading “ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 3”
ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 2
Saving and loading the model Let’s take a moment to recap what we’ve accomplished so far. Before we can save a model, the crucial first step is training it. I’ve extensively covered model training in previous articles, where we explored various techniques, including K-Fold cross-validation. Below, I’ve included all the code necessary for model training.Continue reading “ML Zoomcamp 2023 – Deploying Machine Learning Models– Part 2”