Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AdGrass – Machine Learning Ad Recommendation Engine

Overview

AdGrass is a Machine Learning-powered advertisement recommendation engine designed to simulate personalized ad delivery during live sports events. The system predicts the most relevant advertisement category for each user using demographic information, viewing behavior, engagement history, and device type.

The project leverages a Random Forest Classifier to analyze user data and generate accurate advertisement recommendations, demonstrating how machine learning can improve user engagement and advertising efficiency.


Features

  • Personalized advertisement recommendations
  • Random Forest-based classification model
  • User behavior analysis
  • Demographic-based targeting
  • Device-aware recommendation system
  • Web interface built with Flask
  • Analytics dashboard for recommendation insights
  • Model persistence using Joblib
  • CSV-based dataset support

Project Architecture

                User Data
                      │
      ┌───────────────┼───────────────┐
      │               │               │
 Demographics   Viewing History   Device Type
                      │
                Data Preprocessing
                      │
              Feature Engineering
                      │
          Random Forest Classifier
                      │
         Advertisement Recommendation
                      │
          Flask Web Application
                      │
             Recommendation Output

Technology Stack

Category Technologies
Language Python 3
Machine Learning Scikit-learn
Data Processing Pandas, NumPy
Backend Flask
Model Storage Joblib
Visualization Streamlit (Analytics Dashboard)
Version Control Git & GitHub

Machine Learning Workflow

  1. Load user dataset
  2. Clean and preprocess data
  3. Encode categorical features
  4. Split dataset into training and testing sets
  5. Train Random Forest Classifier
  6. Evaluate model performance
  7. Save trained model
  8. Deploy through Flask
  9. Generate advertisement recommendations

Input Features

The model considers several user attributes including:

  • Age
  • Gender
  • Location
  • Preferred Sport
  • Viewing Time
  • Device Type
  • Previous Advertisement Engagement
  • Watch Duration
  • Click History

Output

The model predicts the most suitable advertisement category, such as:

  • Sports Equipment
  • Electronics
  • Food & Beverages
  • Fashion
  • Travel
  • Gaming
  • Health & Fitness
  • Streaming Services

Dataset

The project uses a structured CSV dataset containing user behavioral and demographic information.

Example:

Age Gender Sport Device Watch Time Previous Clicks Recommended Ad
24 Male Cricket Mobile 120 min Yes Sports Equipment
31 Female Football Smart TV 90 min No Food & Beverage

Installation

Clone the repository:

git clone https://github.com/yourusername/AdGrass.git

Move into the project directory:

cd AdGrass

Create a virtual environment:

Windows

python -m venv .venv

Activate it:

.venv\Scripts\activate

Install dependencies:

pip install -r requirements.txt

Running the Project

Train the model:

python train_model.py

Run the Flask application:

python app.py

Launch the analytics dashboard:

streamlit run analytics.py

Project Structure

AdGrass/
│
├── app.py
├── train_model.py
├── analytics.py
├── requirements.txt
├── README.md
│
├── models/
│   └── random_forest_model.pkl
│
├── data/
│   ├── dataset.csv
│   └── ad_logs.csv
│
├── templates/
│   └── index.html
│
├── static/
│   ├── css/
│   └── images/
│
└── utils/
    └── preprocessing.py

Model

Algorithm

Random Forest Classifier

Why Random Forest?

  • Handles categorical and numerical features effectively
  • Reduces overfitting through ensemble learning
  • High prediction accuracy
  • Robust to noisy data
  • Provides feature importance analysis

Evaluation Metrics

Typical evaluation metrics include:

  • Accuracy
  • Precision
  • Recall
  • F1 Score
  • Confusion Matrix

Example:

Accuracy : 92.4%

Precision : 91%

Recall : 93%

F1 Score : 92%

Future Improvements

  • Deep Learning recommendation models
  • Real-time recommendation engine
  • Collaborative filtering
  • Hybrid recommendation system
  • User feedback learning
  • Cloud deployment
  • REST API support
  • Live sports streaming integration
  • A/B testing framework

Applications

  • Sports streaming platforms
  • OTT services
  • Online advertising
  • Digital marketing
  • Personalized recommendation systems
  • Smart TV advertising
  • Mobile advertising platforms

Learning Outcomes

This project demonstrates:

  • Machine Learning model development
  • Classification using Random Forest
  • Data preprocessing
  • Feature engineering
  • Model deployment with Flask
  • Analytics dashboard development
  • Recommendation system design
  • End-to-end ML pipeline implementation

Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a new branch
git checkout -b feature-name
  1. Commit changes
git commit -m "Add new feature"
  1. Push the branch
git push origin feature-name
  1. Open a Pull Request

License

This project is licensed under the MIT License.


Author

Developed by: [Your Name]

Machine Learning | Artificial Intelligence | Python | Flask | Scikit-learn


Acknowledgements

  • Scikit-learn
  • Flask
  • Pandas
  • NumPy
  • Streamlit
  • Open Source Community

About

AdGrass is a machine learning-powered ad recommendation engine designed to simulate personalized advertisement delivery during live sports events. The system uses a Random Forest Classifier to predict the most relevant advertisement category for each user based on demographic information, viewing behavior, engagement history, and device type.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages