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.
- 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
User Data
│
┌───────────────┼───────────────┐
│ │ │
Demographics Viewing History Device Type
│
Data Preprocessing
│
Feature Engineering
│
Random Forest Classifier
│
Advertisement Recommendation
│
Flask Web Application
│
Recommendation Output
| 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 |
- Load user dataset
- Clean and preprocess data
- Encode categorical features
- Split dataset into training and testing sets
- Train Random Forest Classifier
- Evaluate model performance
- Save trained model
- Deploy through Flask
- Generate advertisement recommendations
The model considers several user attributes including:
- Age
- Gender
- Location
- Preferred Sport
- Viewing Time
- Device Type
- Previous Advertisement Engagement
- Watch Duration
- Click History
The model predicts the most suitable advertisement category, such as:
- Sports Equipment
- Electronics
- Food & Beverages
- Fashion
- Travel
- Gaming
- Health & Fitness
- Streaming Services
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 |
Clone the repository:
git clone https://github.com/yourusername/AdGrass.gitMove into the project directory:
cd AdGrassCreate a virtual environment:
python -m venv .venvActivate it:
.venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtTrain the model:
python train_model.pyRun the Flask application:
python app.pyLaunch the analytics dashboard:
streamlit run analytics.pyAdGrass/
│
├── 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
Algorithm
Random Forest Classifier
- Handles categorical and numerical features effectively
- Reduces overfitting through ensemble learning
- High prediction accuracy
- Robust to noisy data
- Provides feature importance analysis
Typical evaluation metrics include:
- Accuracy
- Precision
- Recall
- F1 Score
- Confusion Matrix
Example:
Accuracy : 92.4%
Precision : 91%
Recall : 93%
F1 Score : 92%
- 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
- Sports streaming platforms
- OTT services
- Online advertising
- Digital marketing
- Personalized recommendation systems
- Smart TV advertising
- Mobile advertising platforms
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
Contributions are welcome.
- Fork the repository
- Create a new branch
git checkout -b feature-name- Commit changes
git commit -m "Add new feature"- Push the branch
git push origin feature-name- Open a Pull Request
This project is licensed under the MIT License.
Developed by: [Your Name]
Machine Learning | Artificial Intelligence | Python | Flask | Scikit-learn
- Scikit-learn
- Flask
- Pandas
- NumPy
- Streamlit
- Open Source Community