https://github.com/wahyudesu/marketing-spend-optimization-using-machine-learning
https://github.com/wahyudesu/marketing-spend-optimization-using-machine-learning
ensemble ensemble-machine-learning marketing optimization python
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wahyudesu/marketing-spend-optimization-using-machine-learning
- Owner: wahyudesu
- Created: 2024-03-20T21:25:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-20T21:46:31.000Z (about 1 year ago)
- Last Synced: 2024-11-14T17:19:37.469Z (7 months ago)
- Topics: ensemble, ensemble-machine-learning, marketing, optimization, python
- Language: HTML
- Homepage:
- Size: 4.74 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **Marketing Spend Optimization using Machine Learning in Python**
# **Introduction**
A company specializing in B2C sales (product: Data Science and Data Engineering related courses) spends significant money on marketing campaigns across various channels such as social media, email, and search advertising. More information on marketing sources can be found in the data column “Marketing Source”. The marketing team faces challenges in optimizing the marketing budget allocation across these channels to maximize revenue and return on investment (ROI).
This project aims to develop a data-driven approach to optimize the marketing budget allocation across various channels to maximize revenue and ROI. By using machine learning algorithms, the marketing team can make informed decisions about allocating the marketing budget based on predicted revenue and ROI.### **Business Impact of Marketing Budget Optimization**
**Increase product conversions**: Marketing Budget Optimization leads to righ user targeting through right channels/assets which leads to better conversions.
**Increase revenue**: Increased conversions(as mentioned in point above) will lead to more revenue or buyer engagement. For example, if the company is able to target a user who is more active on Instagram, chances are more that he/she will click on the Ad and add the product to cart. So overall probability of an order increases and hence the revenue.
**Improve budget allocation**: Over budgeting on non-efficient channels lead to waste of marketing money without getting enough revenue.
**Improve Customer Acquisition Cost**: Customer Acquisition Cost(CAC) improves if right targeting channels are used for a customer often leading to better repeat rates as well.
## **Approach**
We are treating this problem as an supervised learning problem. So every data point will have a target variable for the model to learn the dependencies and predict on the unknown.
In real life, this model would tell the business whether a user is likely to engage with the ad or not and that would in turn help the company to allocate budgets accordingly.
Given our assumptions about the data, we will build a prediction model based on the historical data. Simplifying, here's the logic of what we'll build:
1. We'll build a model to identify if a customer will be interested in the lead;
2. We'll use various tree based model and compare their performance on interest prediction;
3. We will then choose the most successful model to use in production;* Exploratory Data Analysis (EDA):
* Understand the features and their relationships with target variables
* Check for missing or invalid values and their imputation* Data Preprocessing:
* Encode the variables using label encoding
* Split the dataset into training and testing sets* Model Building and Testing:
* Random Forest
* Light Gradient Boosting
* Extreme Gradient BoostingClick here to view more
# **Execution Instructions**
### **Installation and Setup for IPYNB**
For the best experience, please stay connected to the internet while executing this Project
#### **Running an IPYNB on Google Colab**:
* Open the [Google Colab website](https://colab.research.google.com/).
* Click on the "New Notebook" button.
* Click the "File" menu in the new notebook and choose "Upload notebook."
* Select the IPYNB file(notebooks/churn_modeling.ipynb) you want to upload.
* Once the file is uploaded, click on the "Runtime" menu and choose "Run all" to execute all the cells in the notebook.
* Alternatively, you can execute each cell individually by clicking the "Play" button next to the cell OR by pressing `"shift” + "enter"`.
* The Default version of Python that Colab uses currently is 3.8#### **Python setup steps for Local Machine**:
* If you're using a local machine and do not have Python installed, follow these steps to set up Python:
* Download and install the latest version of Python from the official Python website: https://www.python.org/downloads/.
* Once the installation is complete, open a command prompt/terminal and type the following command to check if Python is installed `python –-version`
* If Python is installed, the version number will be displayed.
* This Project has been created using **Python version 3.8.10**#### **Setting up a Python Virtual Environment on Windows**
* Open a command prompt by pressing `Windows Key + R`, type `cmd`, and press `Enter`.
* Navigate to the directory where you want to create the virtual environment.
* Install virtualenv by running the command in the command prompt `pip install virtualenv`
* Create a new virtual environment by running the command `virtualenv env`
* This will create a new directory called `env`, containing the virtual environment.
* Activate the virtual environment by running the command `env\Scripts\activate`
* You can now install packages and work on your project within this virtual environment.
* To deactivate the virtual environment, simply run the command `deactivate`#### **Setting up a Python Virtual Environment on Mac**
* Open the Terminal by pressing `Command + Spacebar`, type `Terminal`, and press `Enter`.
* Navigate to the directory where you want to create the virtual environment.
* Install virtualenv by running the following command in the terminal `pip install virtualenv`
* Create a new virtual environment by running the following command `virtualenv env`
* This will create a new directory called `env`, containing the virtual environment.
* Activate the virtual environment by running the following command `source env/bin/activate`
* You can now install packages and work on your project within this virtual environment.
* To deactivate the virtual environment, simply run the following command `deactivate`#### **Setting up a Python Virtual Environment on Linux**
* Open the Terminal by pressing `Ctrl + Alt + T`.
* Navigate to the directory where you want to create the virtual environment.
* Install `virtualenv` by running the following command in the terminal `sudo apt-get install python3-virtualenv`
* Create a new virtual environment by running the following command `virtualenv -p python3 env`
* This will create a new directory called `env`, containing the virtual environment.
* Activate the virtual environment by running the following command `source env/bin/activate`
* You can now install packages and work on your project within this virtual environment.
* To deactivate the virtual environment, simply run the following command `deactivate`#### **Installing Jupyter with pip**
If pip is installed on your local machine, you can install Jupyter.Here are the steps:
* Open the command prompt (Windows) or terminal (Mac/Linux).
* Install Jupyter with pip by running the following command `pip install jupyter`
* Launch Jupyter Notebook by running the following command `jupyter notebook`#### **Installing Jupyter with Conda**
* Download and install Anaconda from the official website: https://www.anaconda.com/products/individual.
* Open the Anaconda Navigator App and launch Jupyter Notebook
* Running IPYNB in Jupyter Notebook
* Open Terminal / Command Prompt and Navigate to the notebooks directory using cd
* Launch Jupyter Notebook by running the following command jupyter notebook
* This will open a browser window displaying the Jupyter interface.
* Click on the IPYNB file you want to open.
* To execute all the cells in the notebook, click on the "Cell" menu and choose "Run all".
* Alternatively, you can execute each cell individually by clicking on the "Play" button next to the cell.# Executing the project via Modular Code
* Install the dependencies using the command, navigate to the **Marketing Spend Optimization using Machine Learning in Python** directory where the requirements.txt file exists, and run ***pip install -r requirements.txt*** in the terminal/CMD.* Navigate to the src folder in the project directory using the cd command
* Run the command python Engine.py in Terminal or run the Engine.py file in either VScode or PyCharm.