The dataset used for maternal health risk prediction consists of 6 vital health features and a target label. These features include: Blood Pressure (Diastolic and Systolic), Body Temperature, Glucose Level, Pulse Rate, Age, and Risk Level. The target label categorizes risks into three classes: High Risk, Mid Risk, and Low Risk.
The aim is to predict maternal risk as either low, mid, or high risk.
Rows
Missing Rows
Columns
Outliers
- The dataset is loaded to Pandas dataframe.
- This is done by reading the csv allowing us to easily manipulate the data.
We inspect the dataset to understand the distributions, missing values, and general structure of the data. This includes using statistical summaries and visualization tools.
- From the graph, we can pick out for example that the age distribution is skewed towards younger individuals.
- Body Temp: This is generally consistent with a normal of 98.6 degrees F but shows some cases of fever of 103 degrees.
Categorical variable(risklevel) is encoded into numerical representations using label encoding for it to be fit for training.
- Using boxplots, we identify the outliers.
- We then cap them to ensure the data is robust and avoids skewing the model's performance.
To normalize feature ranges, the scaling technique Standard Scaling was applied. This ensures uniformity across all features.
- There was an imbalance in the classes.
- This was addressed using the Synthetic Minority Oversampling Technique (SMOTE), generating synthetic samples for underrepresented classes.
The df is split into training, validation, and testing sets to evaluate the model's performance on unseen data.
Features were ranked based on importance and selected only those that significantly contribute to the model's predictions.
The preprocessing pipeline, including scalers and data splits, is saved for reproducibility and consistency during model training and deployment.