How rajatkapoor01/heart-disease-prediction works
Main Components
• Data & Model Training:
• Data Source: The CSV file (heart.csv) serves as the dataset.
• Notebook: “Heart disease predicition.ipynb” illustrates the experimentation, data preprocessing, feature engineering, and model training steps.
• Model Artifact: “heart_disease_model.sav” is the saved model after evaluation and selection.
• Application (Backend & Deployment):
• Flask Application: “app.py” forms the backend that loads the ML model for predictions.
• Templates: HTML files (input.html and output.html in the templates directory) provide the user’s frontend interface.
• Static Assets: The images folder holds UI images that support documentation/screenshots.
• Dependencies & Environment:
• Requirements: “requirements.txt” and “lib.txt” ensure that all needed Python libraries (like Pandas, NumPy, Scikit-learn, Flask, etc.) are installed.
• Additional Scripts: “requirements_version_fetching.py” might be used to track or enforce specific package versions.
Relationships and Interactions
• Data Flow: Begin with the data ingestion from heart.csv, passing through preprocessing and model training in the Jupyter Notebook, which in turn produces the saved model.
• Deployment Flow: The Flask app (app.py) loads the trained model (heart_disease_model.sav) and, upon receiving user input via the HTML forms, processes the input data, computes predictions, and sends the result back to the output view.
Architectural Patterns & Design Principles
• Separation of Concerns: The project cleanly separates ML model training from deployment. The experimentation and training occur outside of the deployed application, while the Flask app focuses on delivering predictions.
• Lightweight Web Service: Flask is used to ensure a simple yet effective deployment of the prediction service.