Postpartum depression is a serious mental health condition that can affect mothers after childbirth. Early identification of high‑risk individuals can support timely intervention and better outcomes.
This project builds and compares multiple machine learning models to predict whether a patient is at high risk or low risk of postnatal depression based on clinical and demographic features. The best models and their behavior are further analyzed and visualized using Tableau.
Main goals:
- Build individual models (XGBoost, SVM, Neural Network).
- Build an Ensemble Voting Classifier combining these models.
- Evaluate models using multiple metrics (Accuracy, Precision, Recall, F1, ROC‑AUC).
- Analyze feature importance, model errors, and demographic patterns using Tableau dashboards.
| Existing Technology / Approach | Common Gap / Limitation | PsyPredict's Contribution |
|---|---|---|
| Traditional screening approaches | Depend heavily on manual assessment and may not provide scalable, data-driven risk estimation. | Builds an ML-based risk prediction pipeline for automated assessment of postpartum depression risk. |
| Single ML classifiers | Individual models may provide different performance characteristics and can be sensitive to the underlying dataset. | Benchmarks XGBoost, SVM and neural-network approaches rather than relying on a single classifier. |
| Imbalanced healthcare datasets | Minority-risk cases can be underrepresented, reducing predictive reliability. | Applies preprocessing strategies specifically to address class imbalance. |
| Model-only prediction systems | Prediction outputs can be difficult for non-technical stakeholders to interpret and monitor. | Integrates predictions into an interactive visualization dashboard. |
| Conventional ensemble approaches | Combining models can improve robustness, but effectiveness depends on the models and voting strategy used. | Evaluates an ensemble voting approach, achieving the strongest reported accuracy of 94% in the project evaluation. |
The project combines class-imbalance handling, multi-model benchmarking, ensemble prediction and an interactive monitoring dashboard into a single end-to-end pipeline rather than evaluating a model in isolation.
- File:
post-natal-data.csv - Each row represents a single patient record.
- Columns (examples – adjust to your actual features):
- Demographic features:
Age,Marital_Status,Employment_Status, etc. - Clinical / questionnaire features: scores or yes/no indicators related to mood, sleep, anxiety, etc.
- Target label: e.g.
Risk(values likeHigh_Risk/Low_Riskor 1/0).
- Demographic features:
Typical preprocessing steps used in the notebooks:
- Handling missing values (drop or impute).
- Encoding categorical variables (e.g. one‑hot encoding).
- Train–test split (e.g. 80% train / 20% test).
- Feature scaling where required (especially for SVM and Neural Network).
All models are implemented and evaluated in separate Jupyter notebooks.
- Core steps:
- Load and preprocess data.
- Train an
XGBClassifieron the training set. - Evaluate using:
- Accuracy, Precision, Recall, F1‑score.
- Confusion matrix.
- ROC curve and AUC.
- Export:
- Notebook:
SVM.ipynb - Core steps:
- Notebook:
Neural-Network.ipynb - Core steps:
- Define a feed‑forward neural network (e.g. using Keras / sklearn MLP).
- Train on the training set (with validation).
- Evaluate performance (Accuracy, Precision, Recall, F1, ROC‑AUC).
- Export corresponding evaluation CSVs.
- Notebook:
Ensemble-Voting-Classifier.ipynb - Combines XGBoost, SVM, and Neural Network as base models.
- Uses hard or soft voting (as configured in the notebook).
- Optionally assigns different weights to base models to control their influence.
- Evaluates ensemble performance on the test set and exports:
- Ensemble classification report.
- Ensemble confusion matrix.
- Ensemble ROC data.
- Misclassification summary per base model (for error analysis in Tableau).
- Model weights table (for voting weight visualization in Tableau).
For each model, the following metrics are computed on the test set:
- Accuracy: Overall proportion of correctly classified samples.
- Precision (for High Risk): Out of patients predicted as high risk, how many actually are high risk.
- Recall / Sensitivity (for High Risk): Out of actual high‑risk patients, how many are correctly detected.
- F1‑score: Harmonic mean of precision and recall, balancing both.
- ROC‑AUC: Measures trade‑off between true positive rate and false positive rate across thresholds.
- Confusion Matrix: Counts of True Positives, False Positives, True Negatives, and False Negatives.
Model Accuracy (%) WF1 Score Precision (%) Recall (%) XGB 88 87 89 88 SVM 89 90 91 89 ANN 76 75 75 76 EVM 97 97 97 97
After running the notebooks, several CSV files are generated (metrics, confusion matrices, ROC points, feature importances, misclassification summaries, demographic summaries). These are used to build interactive dashboards in Tableau.
- Source: confusion matrix CSV for each model.
- In Tableau:
- Rows: Actual class.
- Columns: Predicted class.
- Color/Label: Count of samples.
- Source: ROC points CSV (FPR, TPR, threshold) for each model.
- In Tableau:
- Columns: False Positive Rate.
- Rows: True Positive Rate.
- Color: Model name (for multiple curves on one plot).
- Source: classification report CSV.
- In Tableau:
- Columns: Metric (Precision, Recall, F1).
- Rows: Value.
- Color: Model or Class.
- Source: feature importance CSV from XGBoost (and optionally coefficients from linear models).
- In Tableau:
- Rows: Feature.
- Columns: Importance score.
- Chart: Horizontal bar chart, sorted descending to highlight top features.
- Source: a combined CSV summarizing metrics for all models.
- In Tableau:
- Columns: Model.
- Rows: Metric value.
- Color: Metric type (Accuracy, F1, etc.).
- Source: misclassification summary CSV per model (e.g.,
Model, Misclassifications, ErrorRate). - In Tableau:
- Rows: Model.
- Columns: Misclassifications or ErrorRate.
- Color: ErrorRate to highlight weaker models.
- Source: processed dataset including demographics and labels.
- In Tableau:
- Use fields such as Age group, Gender, Region vs. Risk class.
- Visualize distribution of high‑risk vs low‑risk across demographic groups.
PsyPredict — An EVM Based Postpartum Depression Predictor IEEE Publication.
-Perform systematic hyperparameter tuning (GridSearchCV / RandomizedSearchCV). -Use cross‑validation for more robust evaluation. -Add interpretability tools such as SHAP or LIME to explain predictions. -Deploy the best model as a web API or simple app for clinicians. -Add automated data validation and logging for real‑world use.
Have an idea for improving PsyPredict? Contributions and new approaches are always welcome — feel free to open an issue or reach out to me on LinkedIn to collaborate on future enhancements.

