A sophisticated machine learning-powered web application that predicts whether a movie will be a hit or a flop. This interactive quiz game lets users test their intuition against a trained ML model while learning about the factors that contribute to a movie's success.
- Overview
- Features
- Technical Architecture
- Machine Learning Model
- Data Collection & Processing
- Installation & Setup
- API Reference
- Project Structure
- Contributing
- Team
- License
- Acknowledgments
The Movie Success Predictor combines data science with an engaging user interface to create an educational game about movie success prediction. Users can:
- Guess whether a movie was a hit or flop based on its details
- Compare their predictions with a machine learning model
- Learn about the factors that influence movie success
- Filter movies by genre, country, and rating
- Track their prediction accuracy
- Beautiful, responsive movie cards with TMDB posters
- Real-time feedback on user predictions
- Visual effects for correct/incorrect guesses
- Timer-based gameplay for added challenge
- Score tracking and statistics
- Filter movies by:
- Genre
- Country of origin
- MPAA rating (certification)
- Adjustable game settings
- Premium UI with animations and transitions
- Real-time predictions using Logistic Regression
- Model confidence scores
- Comparison between user and model predictions
- Educational insights into prediction factors
- Modern React with TypeScript for type safety
- Vite for fast development and building
- Tailwind CSS for responsive styling
- Custom hooks for state management
- Component-based architecture
- Flask REST API
- CORS support for local development
- Environment-based configuration
- Scikit-learn for ML predictions
- TMDB API integration for movie posters
- Data collection via TMDB API
- Preprocessing and feature engineering
- Model training and evaluation
- Real-time prediction serving
- Budget
- Runtime
- Release Year
- Vote Average
- Vote Count
- Certification (MPAA Rating)
- Genre
- Country
- Algorithm: Logistic Regression
- Accuracy: 70.47%
- Features: One-hot encoded categorical variables
- Training Data: 375,377 movies
A movie is considered successful (Hit) if:
- Revenue >= Budget ร 2
- Otherwise classified as a Flop
- Uses TMDB API for movie data
- Collects movies from 1873 to 2020
- Features include:
- Basic movie information
- Financial data (budget/revenue)
- Ratings and popularity
- Production details
-
Data Cleaning
- Removes duplicates
- Handles missing values
- Filters invalid entries
-
Feature Engineering
- Creates success column
- Extracts primary genre
- Processes release dates
- Standardizes country information
- Implements multiple algorithms:
- Logistic Regression
- KNN
- Decision Trees
- Random Forest
- Cross-validation for model selection
- Hyperparameter tuning
- Performance visualization
- Python 3.9+
- Node.js 16+
- TMDB API Key
# Clone the repository
git clone https://github.com/prashantkoirala465/Movie-Success-Predictor.git
cd Movie-Success-Predictor
# Set up Python virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env and add your TMDB_API_KEY
# Start the backend server
cd backend
python app.py# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm run devRetrieves a random movie for prediction.
Query Parameters:
genre: Filter by movie genrecountry: Filter by production countrycertification: Filter by MPAA rating
Response:
{
"id": "string",
"title": "string",
"posterUrl": "string"
}Submit a prediction for a movie.
Request Body:
{
"movieId": "string",
"guess": "Hit" | "Flop"
}Response:
{
"movieId": "string",
"userGuess": "string",
"prediction": "string",
"actualResult": "string",
"isCorrect": boolean,
"feedbackMessage": "string"
}Get available filter options.
Response:
{
"genres": ["string"],
"countries": ["string"],
"certifications": ["string"]
}Movie-Success-Predictor/
โโโ backend/ # Python Flask backend
โ โโโ app.py # Main Flask application
โ โโโ train_model.py # Model training script
โ โโโ data/ # Dataset storage
โ โ โโโ moviesDb.csv # Processed movie dataset
โ โโโ models/ # Trained ML models
โ โโโ logistic_regression_model.joblib
โ โโโ model_columns.joblib
โโโ frontend/ # React frontend
โ โโโ src/
โ โ โโโ components/ # Reusable React components
โ โ โ โโโ MovieCard.tsx
โ โ โ โโโ QuizControls.tsx
โ โ โ โโโ ...
โ โ โโโ pages/ # Page components
โ โ โโโ services/ # API services
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ assets/ # Static assets
โ โโโ public/ # Public assets
โโโ data-collection/ # Data collection scripts
โ โโโ scrape-movies.py # TMDB data scraper
โ โโโ preprocessing.py # Data preprocessing
โโโ ml/ # Machine learning
โ โโโ classification.py # Model training
โโโ docs/ # Documentation
โ โโโ preview.png # Project preview
โโโ .env.example # Example environment variables
โโโ requirements.txt # Python dependencies
โโโ .gitignore # Git ignore rules
โโโ README.md # Project documentation
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Make your changes
- Run tests and linting
- Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Prashant Koirala - Project Lead & Full Stack Developer
- Aaska Koirala - Machine Learning Engineer
- Aishmita Yonzan - UI/UX Designer
This project is licensed under the MIT License - see the LICENSE file for details.
- TMDB API for movie data
- Scikit-learn for machine learning tools
- React and Vite communities
- Tailwind CSS for styling
- All contributors and testers
