How gnhd/student-performance-analytics works
Main Components Identification
• Frontend: Represented by the "Frontend" folder which includes index.html, script.js, and styles.css. This component handles the user interface, takes user input (both CSV uploads and manual input), and displays data visualizations.
• Backend: Represented by the "Backend" folder. Key files include api.py (FastAPI endpoints for handling requests), model.py (machine learning model training and predictions), and CompareModel.py (possibly for comparing multiple models). This component processes data, makes predictions, and serves API responses.
• Machine Learning Models and Assets: Inside the Backend, you have serialized model files (like student_performance_gb.pkl, student_performance_rf.pkl) and scaling objects (scaler_gb.pkl, scaler_rf.pkl) which form the core of the prediction functionality.
• Data Storage: The "Data" directory holds the CSV file with student performance data. This is used for batch predictions and model training.
• Supporting Components: Additional elements like __pycache__ directories indicate compiled Python files and a requirements.txt file for dependency management.
Relationships and Interactions
• The Frontend interacts directly with the Backend via two main API endpoints:
• One endpoint for batch predictions (accepting CSV files).
• A second endpoint for real-time/single student predictions.
• When a user submits data via the frontend (either by form input or file upload), the JavaScript (script.js) makes an API call to the FastAPI backend.
• The backend (in api.py) receives the requests, calls the prediction logic in model.py (and potentially CompareModel.py), and then uses the machine learning model(s) to generate predictions.
• The backend then sends a JSON response with the prediction results back to the frontend, which renders the output and visualizations.
• Additionally, visualization libraries (like Matplotlib, as mentioned in the README) may be used to generate graphs showing student performance trends.
Architectural Patterns and Design Principles
• Layered Separation: The project cleanly separates the frontend (presentation layer) and backend (business logic/data processing layer).
• API-Driven Communication: The FastAPI backend exposes RESTful endpoints which the frontend consumes.
• Component Modularity: Distinction between model storage, data handling, and prediction logic suggests organized, modularized code.
Relevant Technologies & Libraries
• Backend: Python, FastAPI, scikit-learn, Joblib (for model persistence), and potentially Matplotlib for visualization.
• Frontend: Plain HTML, CSS, and JavaScript.
• Data: CSV file for batch predictions.