Skip to content

bmguillo/Python_ML_Project

Repository files navigation

Data Science Capstone Project: Targeted Marketing Campaign Prediction

Python Jupyter License

IBM Applied Data Science Capstone Project - Completed March 10, 2020 Author: Brandy Guillory

Table of Contents

Project Overview

This capstone project demonstrates the application of data science methodologies to solve real-world marketing challenges. The project focuses on Targeted Marketing Campaign Prediction & User Behavior Analysis using machine learning techniques including K-Means Clustering, Classification, and Regression algorithms.

Background

Marketing has evolved from traditional radio and television advertising to highly personalized, data-driven digital campaigns. This project leverages the vast amounts of user data collected daily to create more targeted and personalized advertising campaigns that improve customer experience and drive revenue generation.

Business Problem

Scenario: An employee at a fictitious big data marketing company, Insights LLC, has been tasked with helping a client determine ideal marketing campaigns based on user behavior in specific geographic regions.

Objective: Launch four successful marketing campaigns to:

  • Increase revenue for the client
  • Create more personalized experiences for target customer segments
  • Identify user behavior patterns for positive and negative trends in customer satisfaction

Target Cities: Atlanta, San Francisco, and New Orleans

Key Features

  • Geographic Data Analysis: Web scraping and geocoding of neighborhood data from Wikipedia
  • Venue Analysis: Integration with Foursquare API to retrieve venue and check-in data
  • Customer Segmentation: K-Means clustering for identifying distinct customer groups
  • Predictive Modeling: Classification and regression algorithms for campaign prediction
  • Interactive Visualizations: Folium maps for geographic data visualization
  • Data Processing: Comprehensive data cleaning and feature engineering

Technologies Used

Core Technologies

  • Python 3.6+
  • Jupyter Notebook

Libraries & Frameworks

# Data Processing & Analysis
- pandas
- numpy

# Machine Learning
- scikit-learn (K-Means, Classification, Regression)

# Data Visualization
- matplotlib
- seaborn
- folium

# Web Scraping & APIs
- BeautifulSoup
- requests
- Foursquare API

# Geospatial Analysis
- geocoder
- geopy (Nominatim)

Project Structure

Python_ML_Project-master/
│
├── README.md                                          # Project documentation
│
├── Notebooks/
│   ├── Capstone-FinalProject-Notebook.ipynb          # Main capstone notebook (K-Means)
│   ├── Final Capstone Project.ipynb                  # Classification & Regression analysis
│   ├── Applied Data Science Capstone.ipynb           # Toronto neighborhood segmentation
│   ├── PythonGeocoder_Folium_Clustering.ipynb        # Geocoding & clustering visualization
│   ├── PythonGeocoder.ipynb                          # Geocoding implementation
│   ├── Final Capstone Project - Week 4 - Foursquare - Part 1.ipynb
│   └── ML Notebook.ipynb                             # Initial ML exploration
│
├── data/
│   └── sfcrimedata.csv                               # San Francisco crime dataset
│
├── python_code.py                                     # Python utility scripts
└── Targeted Marketing Campaign Prediction.pdf         # Project presentation

Methodology

1. Data Collection

  • Web Scraping: Extracted neighborhood data from Wikipedia using BeautifulSoup
  • Geocoding: Retrieved latitude/longitude coordinates using Nominatim geocoder
  • API Integration: Collected venue data from Foursquare Places API
  • Crime Data: Analyzed San Francisco crime statistics for safety insights

2. Data Preprocessing

  • Cleaned and transformed raw data
  • Handled missing values and duplicates
  • Feature engineering for model input
  • Normalized and scaled numerical features

3. Exploratory Data Analysis (EDA)

  • Statistical analysis of neighborhood characteristics
  • Venue distribution analysis
  • Geographic pattern identification
  • Correlation analysis between features

4. Machine Learning Models

K-Means Clustering

  • Segmented neighborhoods based on venue types and characteristics
  • Identified optimal number of clusters using elbow method
  • Created customer personas for targeted marketing

Classification Models

  • Predicted customer response to marketing campaigns
  • Evaluated model performance using accuracy, precision, recall, and F1-score

Regression Models

  • Forecasted campaign ROI and customer lifetime value
  • Analyzed feature importance for marketing decisions

5. Visualization

  • Interactive Folium maps showing neighborhood clusters
  • Heatmaps of venue distributions
  • Cluster visualization with geographic overlays

Results & Insights

Key Findings

  1. Customer Segmentation: Successfully identified 4 distinct customer segments based on geographic and behavioral patterns
  2. Venue Patterns: Discovered strong correlations between venue types and customer preferences
  3. Geographic Insights: Mapped high-value neighborhoods for targeted campaigns
  4. Predictive Accuracy: Achieved strong model performance for campaign prediction

Business Impact

  • Personalized Campaigns: Data-driven approach enables customized marketing strategies
  • Resource Optimization: Focus marketing spend on high-potential customer segments
  • Revenue Growth: Improved targeting leads to higher conversion rates
  • Customer Satisfaction: Better alignment between offerings and customer preferences

Installation & Setup

Prerequisites

Python 3.6 or higher
pip package manager
Jupyter Notebook

Installation Steps

  1. Clone the repository
git clone https://github.com/bmguillo/Python_ML_Project-master.git
cd Python_ML_Project-master
  1. Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install required packages
pip install pandas numpy scikit-learn matplotlib seaborn folium
pip install beautifulsoup4 requests geocoder geopy
pip install jupyter notebook
  1. Set up Foursquare API credentials
  • Sign up for a Foursquare Developer account
  • Create a new app to get your API credentials
  • Add credentials to your notebook environment

Usage

Running the Notebooks

  1. Start Jupyter Notebook
jupyter notebook
  1. Open the main capstone notebook
  • Navigate to Capstone-FinalProject-Notebook.ipynb
  • Run cells sequentially to reproduce the analysis
  1. Explore other notebooks
  • Each notebook focuses on specific aspects of the project
  • Follow the markdown instructions within each notebook

Key Learnings

  • Data Science Workflow: End-to-end project execution from problem definition to deployment
  • Machine Learning: Practical application of clustering, classification, and regression
  • Geospatial Analysis: Working with location data and mapping libraries
  • API Integration: Consuming third-party APIs for data enrichment
  • Business Communication: Translating technical results into business insights

Acknowledgments

  • IBM Data Science Professional Certificate - Coursera
  • Foursquare API - Location data and venue information
  • Wikipedia - Neighborhood and geographic data
  • Open Source Community - Python libraries and tools

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

Brandy Guillory


If you found this project helpful, please consider giving it a star!

This project was completed as part of the IBM Applied Data Science Capstone course on Coursera.

About

This repository demonstrates use of the Python libraries to create ML models

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors