The goal of this task was to clean and preprocess the stroke prediction dataset to make it suitable for machine learning.
- Python
- Pandas
- NumPy
- Seaborn / Matplotlib
- VS Code
task1_preprocessing.py: All code used for loading, cleaning, encoding, standardizing, and saving the dataset.cleaned_stroke_data.csv: Final cleaned dataset.images/: Folder containing screenshots or plots (boxplots, missing value heatmap, etc.)
- Load Dataset: Imported CSV using pandas.
- Handle Missing Values: Filled missing
bmiusing median. - Encode Categorical Features: Used
pd.get_dummies()withdrop_first=True. - Standardize Numerical Features: Used
StandardScalerfrom sklearn. - Remove Outliers: Used boxplots and IQR method.
- Save Cleaned Data: Exported final dataset to
cleaned_stroke_data.csv.
The cleaned dataset was exported as a CSV file using pandas.DataFrame.to_csv(). You can find the final version in cleaned_stroke_data.csv.