Building a Smart Student Placement Prediction System with Flask and Machine Learning
Finding the right career path is one of the most critical transitions in a student's academic journey. To bridge the gap between academic preparation and industry recruitment, I developed the Student Placement Prediction System—an end-to-end, production-ready web application powered by Machine Learning.
In this article, I will walk you through the system architecture, the machine learning pipeline under the hood, and how the entire application is structured.
🚀 Key Features
- User Authentication: Secure student registration and session logins, along with dedicated Administrator views.
- Interactive Academic Evaluation: A clean student profile form capturing CGPA, class attendance, projects completed, internships, aptitude scores, and technical/communication ratings.
- ML Prediction Engine: Real-time evaluation powered by a Scikit-learn Random Forest Classifier that returns a placement likelihood percentage.
- Actionable Career Recommendations: A rule-based engine that inspects weak features and generates tailored feedback (e.g., suggesting Git projects for low project counts or coding drills for low technical scores).
- Admin Console & Analytics Hub: An administrative dashboard with data filtering, CSV report downloads, and Chart.js graphs displaying class performance spreads.
- Premium Responsive UI: Built using Bootstrap 5 with modern glassmorphism, fluid animations, and a dynamic Light/Dark mode.
🛠️ Tech Stack & Architecture
The system uses a modular, decoupled architecture:
- Frontend: HTML5, CSS3, JavaScript (ES6), Bootstrap 5, Chart.js (for graphics).
- Backend: Python (Flask web server framework).
- Database: SQLite3.
- Machine Learning: Scikit-learn, Pandas, Numpy, Joblib.
+-----------------------------------+
| User Browser |
+-----------------+-----------------+
|
v (HTTP request)
+-----------------+-----------------+
| Flask Server (app.py) |
+--------+-----------------+--------+
| |
(Auth & SQL Queries) | | (Data Transformations)
v v
+--------------------------+----+ +---------+-----------------+
| SQLite Database (database.py) | | Preprocessor (scaler) |
+-------------------------------+ +---------+-----------------+
|
v (Scaled Array)
+---------+-----------------+
| ML Classifier (joblib) |
+---------------------------+
🧠 The Machine Learning Pipeline
1. Dataset & Feature Matrix
The model analyzes nine scholastic and personal parameters:
- Academic Profile: CGPA, Class Attendance (%).
- Experience: Number of Projects, Number of Internships.
- Cognitive & Soft Skills: Aptitude Score (0-100), Communication Rating (1-10), Technical Rating (1-10).
- Demographics: Age, Gender.
2. Preprocessing & Scaling
Continuous variables (CGPA, Attendance, ratings) differ greatly in scale. To prevent features with larger ranges (like Aptitude) from biasing the classification, a StandardScaler was used to standardize inputs. Categorical fields (Gender) were binary encoded.
3. Model Training
We selected a Random Forest Classifier due to its robustness against overfitting and ability to output probability scores (predict_proba). Trained on 800 samples, the model achieved 79.0% accuracy on the validation set.
💻 Code walkthrough
Flask Routing & ML Execution
The main server endpoint receives the parameters, scales the data using the serialized scaler, feeds it to the Random Forest model, and triggers recommendations:
# Scale parameters
scaled_features = scaler.transform(feature_df)
# Predict probability and outcome
prob = model.predict_proba(scaled_features)[0][1] * 100
pred_result = int(model.predict(scaled_features)[0])
# Generate recommendations
recommendations = []
if cgpa < 7.5:
recommendations.append("Enhance your academic grades. Focus on raising your CGPA above 7.5 to clear recruitment filters.")
if technical < 7:
recommendations.append("Improve core programming concepts. Participate in bootcamps and coding challenges.")
SQLite DB Integrations
SQLite acts as the system registry. It tracks users, student profiles, and historical prediction outputs using foreign key cascades:
CREATE TABLE Students (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
name TEXT NOT NULL,
cgpa REAL NOT NULL,
FOREIGN KEY(user_id) REFERENCES Users(id) ON DELETE CASCADE
);
🐳 Containerization & Deployment
To simplify deployment, the project includes a Dockerfile and a docker-compose.yml file. This lets developers launch the entire server—complete with the WSGI Waitress setup—in seconds with:
docker-compose up --build
📈 Conclusion
This system demonstrates how machine learning can be cleanly integrated into standard web architectures. By combining predictive analysis with actionable recommendations, the platform moves beyond classification into a supportive career advisory portal.
Check out the full source code and setup instructions on my GitHub repository:
👉 Nakshatra018 / Student-Placement-Prediction
Top comments (0)