Self-paced

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Search from all Lessons


LoginGet Started

Register to 4Geeks

โ† Back to Projects

Logistic Regression Project Tutorial

Difficulty

  • intermediate

Average duration

2 hrs

Technologies

Difficulty

  • intermediate

Average duration

2 hrs

Technologies

๐ŸŒฑ How to start this project
๐Ÿ“ Instructions
  • Banking Marketing Campaign
  • Understand a new dataset.
  • Process it by applying exploratory data analysis (EDA).
  • Model the data using logistic regression.
  • Analyze the results and optimize the model.

๐ŸŒฑ How to start this project

Follow the instructions below:

  1. Create a new repository based on machine learning project by clicking here.
  2. Open the newly created repository in Codespace using the Codespace button extension.
  3. Once the Codespace VSCode has finished opening, start your project by following the instructions below.

๐Ÿš› How to deliver this project

Once you have finished solving the exercises, be sure to commit your changes, push them to your repository, and go to 4Geeks.com to upload the repository link.

๐Ÿ“ Instructions

Banking Marketing Campaign

Business Insight

Long-term deposits allow banks to hold money for a specific period of time, allowing the bank to use that money to enhance its investments. Marketing campaigns for this product are based on phone calls. If a user is not available at a given time, then they will be called back at another time.

Description of the problem

The Portuguese bank is experiencing a decline in revenue, so they want to be able to identify existing customers who are more likely to take out a long-term deposit. This will allow the bank to focus their marketing efforts on those customers and avoid wasting money and time on customers who are unlikely to sign up.

To address this problem we will create a ranking algorithm to help predict whether or not a customer will sign up for a long-term deposit.

Step 1: Loading the dataset

The dataset can be found in this project folder under the name bank-marketing-campaign-data.csv, and you can load it into the code directly from this link:

1https://raw.githubusercontent.com/4GeeksAcademy/logistic-regression-project-tutorial/main/bank-marketing-campaign-data.csv

Or download it, and add it by hand in your repository. In this dataset, you will find the following variables:

  1. age. Age of customer (numeric)
  2. job. Type of job (categorical)
  3. marital. Marital status (categorical)
  4. education. Level of education (categorical)
  5. default. Do you currently have credit (categorical)
  6. housing. Do you have a housing loan (categorical)
  7. loan. Do you have a personal loan? (categorical)
  8. contact. Type of contact communication (categorical)
  9. month. Last month in which you have been contacted (categorical)
  10. day_of_week. Last day on which you have been contacted (categorical)
  11. duration. Duration of previous contact in seconds (numeric)
  12. campaign. Number of contacts made during this campaign to the customer (numeric)
  13. pdays. Number of days that elapsed since the last campaign until the customer was contacted (numeric)
  14. previous. Number of contacts made during the previous campaign to the customer (numeric)
  15. poutcome. Result of the previous marketing campaign (categorical)
  16. emp.var.rate. Employment variation rate. Quarterly indicator (numeric)
  17. cons.price.idx. Consumer price index. Monthly indicator (numeric)
  18. cons.conf.idx. Consumer confidence index. Monthly indicator (numeric)
  19. euribor3m. EURIBOR 3-month rate. Daily indicator (numeric)
  20. nr.employed. Number of employees. Quarterly indicator (numeric)
  21. y. TARGET. Whether the customer takes out a long-term deposit or not (categorical)

Step 2: Perform a full EDA

This second step is vital to ensure that we keep the variables that are strictly necessary and eliminate those that are not relevant or do not provide information. Use the example Notebook we worked on and adapt it to this use case.

Be sure to conveniently divide the data set into train and test as we have seen in previous lessons.

Step 3: Build a logistic regression model

You do not need to optimize the hyperparameters. Start by using a default definition and improve it in the next step.

Step 4: Optimize the previous model

After training the model, if the results are not satisfactory, optimize it using one of the techniques seen above.

Note: We also incorporated the solution samples on ./solution.ipynb that we strongly suggest you only use if you are stuck for more than 30 min or if you have already finished and want to compare it with your approach.

Sign up and get access to solution files and videos

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • intermediate

Average duration

2 hrs

Technologies

Difficulty

  • intermediate

Average duration

2 hrs

Technologies

Difficulty

  • intermediate

Average duration

2 hrs

Technologies

Difficulty

  • intermediate

Average duration

2 hrs

Technologies

Sign up and get access to solution files and videos

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • intermediate

Average duration

2 hrs

Technologies

Difficulty

  • intermediate

Average duration

2 hrs

Technologies