This project uses machine learning to analyze historical Bihar Vidhan Sabha election data (2000โ2020) and predict whether a legislative race will be tight or safe.
The aim is to assist political analysts, journalists, and data scientists by providing a predictive model that classifies election races based on:
- Voter turnout
- Party affiliation
- Constituency type (General/SC/ST)
- Margin and percentage of victory
- Total electors and votes polled
โโโ app.py # Flask web app โโโ election_race_model.pkl # Trained machine learning model โโโ IndiaVotes_Bihar.csv # Historical election data (2000โ2020) โโโ templates/ # HTML templates for the web app โโโ .gitignore โโโ README.md # Project documentation (this file)
git clone https://github.com/Vivek-ML001/BiharElection.git
cd BiharElection
2. Install dependencies
Make sure Python is installed. Then run:
pip install -r requirements.txt
> If requirements.txt is not available, use:
pip install pandas scikit-learn flask
3. Run the app
python app.py
Then open your browser at http://127.0.0.1:5000
๐ Model Details
Algorithm: (e.g., Random Forest, Logistic Regression)
Target Label: Tight Race vs Safe Seat
Input Features: Voter Turnout, Party, Constituency Type, Margin %, etc.
โจ Future Improvements
Add visual analytics dashboard
Integrate real-time data scraping
Improve accuracy using ensemble models
Deploy on cloud (Render/Heroku/AWS)
๐ฎ Contact
Made by Vivek Kumar | GitHub Profile
---