CodSoft Data Science Internship โข Task 2
A complete Machine Learning regression pipeline that predicts IMDb movie ratings using 6 regression algorithms with hyperparameter tuning, analyzing features like genre, director, actors, duration, and votes.
15K+
Movies
6
ML Models
12+
Engineered Features
0.74
Rยฒ Score
Understanding the business problem and dataset
Movie ratings are crucial for studios, streaming platforms, and audiences. This project builds a regression model to predict IMDb ratings based on movie attributes.
By analyzing factors like genre, director reputation, cast star power, duration, and audience engagement (votes), we can estimate how well a movie will be received.
| Source | Kaggle (IMDb India) |
| Rows | ~15,000+ |
| Columns | 10 |
| Target | Rating |
| Task | Regression |
| Rating Range | 0 - 10 |
| Column | Type | Description |
|---|
End-to-end workflow executed by python main.py
Complete file organization
6 regression algorithms trained and compared
GridSearchCV with 5-fold cross-validation is performed on the top 2 models. The search explores combinations of hyperparameters to find the optimal configuration that maximizes Rยฒ score.
Random Forest Search Space
n_estimators: [100, 200, 300]
max_depth: [5, 10, 15, None]
min_samples_split: [2, 5]
min_samples_leaf: [1, 2]
Gradient Boosting Search Space
n_estimators: [100, 200, 300]
learning_rate: [0.01, 0.05, 0.1]
max_depth: [3, 5, 7]
min_samples_split: [2, 5]
Key source files from the project
Model performance and generated artifacts
Model
Gradient Boosting
Test Rยฒ
0.7416
CV Rยฒ
0.7544
RMSE
0.6931
MAE
0.4796
Performance table comparing all 6 models across MAE, RMSE, Rยฒ, and CV scores.
Test set predictions with actual ratings, predicted ratings, and absolute errors.
Serialized best model saved with Joblib for reuse without retraining.
Step-by-step instructions
git clone https://github.com/yourusername/Movie_Rating_Prediction.git
cd Movie_Rating_Prediction
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
Download from Kaggle
and place IMDb_Movies_India.csv in the dataset/ folder.
python main.py
This executes the complete ML pipeline automatically.
cd notebook
jupyter notebook Movie_Rating_Prediction.ipynb
python main.py does