clarasellam commited on
Commit
8ba6726
·
verified ·
1 Parent(s): 516ee6e

Added EDA plots, video, and final README

Browse files
devoir data/.DS_Store ADDED
Binary file (6.15 kB). View file
 
devoir data/Age.png ADDED

Git LFS Details

  • SHA256: 3b468acd2389d0dbcacd5290fdae03f03001553a64fcc9a2004e6301f65c3033
  • Pointer size: 130 Bytes
  • Size of remote file: 36.6 kB
devoir data/BMI (1).png ADDED

Git LFS Details

  • SHA256: 7a7286117a548b270848ccb96ae2c09063a4e67997f2dddb860b96ef1150db93
  • Pointer size: 130 Bytes
  • Size of remote file: 49.5 kB
devoir data/Mon film.mov ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:adb2d6957530b146c48a24f90de58bb56089b09d4d033788b4ca7b838700437c
3
+ size 165123907
devoir data/README.md ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CDC Diabetes Health Indicators Analysis
2
+
3
+ ## Project Overview
4
+ This project aims to explore the CDC Diabetes Health Indicators Dataset to identify key health, lifestyle, and socio-economic factors associated with diabetes prevalence.
5
+ We perform **exploratory data analysis (EDA)**, **data cleaning**, and **Logistic Regression modeling** on balanced data.
6
+ The goal is to extract actionable insights, understand class imbalances, and identify the most influential predictors of diabetes.devoir
7
+
8
+
9
+ ## Dataset
10
+
11
+ - **Name**: CDC Diabetes Health Indicators Dataset
12
+ - **Source**: Downloaded from Kaggle using `kagglehub`
13
+ - **Content**: Over 250,000 observations of health and lifestyle factors
14
+ - **Format**: CSV, with multiple columns corresponding to health indicators, lifestyle choices, and socio-economic factors
15
+
16
+ **Initial Verification**: The dataset contains `df.shape[0]` rows and `df.shape[1]` columns.
17
+
18
+
19
+ ## 2.2 Data Cleaning
20
+
21
+ - **Duplicate Handling**: Checked for exact duplicate rows across all features and removed them to ensure each observation is unique.
22
+ - **Missing Values Check**: Verified that there are no missing values in the dataset.
23
+ - **Result**: The dataset is clean, complete, and ready for analysis.
24
+
25
+
26
+ ## 2.3 Target Variable Analysis: Class Imbalance
27
+
28
+ - **Objective**: Assess the distribution of the target variable `Diabetes_binary` to detect potential class imbalance.
29
+ - **Quantification**: Calculated counts and percentages of each class.
30
+ - **Visualization**: Bar plot illustrating the number of non-diabetic vs diabetic/pre-diabetic individuals.
31
+
32
+ **Observation**: The dataset exhibits a class imbalance, which is common in health datasets and must be considered for model training.
33
+
34
+ **Class Imbalance Visualization**:
35
+ ![Class Imbalance](classibalance.png)
36
+
37
+
38
+ ## 4.1 Socio-Economic Factor: Income vs. Diabetes
39
+
40
+ - **Objective**: Explore the relationship between income levels (1 = lowest, 8 = highest) and diabetes prevalence.
41
+ - **Calculation**: Average diabetes rate per income category.
42
+ - **Visualization**: Bar plot showing diabetes prevalence across income levels.
43
+
44
+ **Observation**:
45
+ - Diabetes prevalence decreases steadily with increasing income.
46
+ - Low-income categories (1 and 2) show ~25% diabetes prevalence, while the highest income category (8) shows ~10%.
47
+ - Confirms the hypothesis that socio-economic status strongly affects diabetes risk.
48
+
49
+ **Income vs Diabetes Visualization**:
50
+ ![Income vs Diabetes](income.png)
51
+
52
+
53
+ ## 4.2 Socio-Economic Factor: Education vs. Diabetes
54
+
55
+ - **Objective**: Assess how education level (1 = lowest, 6 = highest) correlates with diabetes prevalence.
56
+ - **Calculation**: Average diabetes rate per education level.
57
+ - **Visualization**: Bar plot comparing prevalence across educational attainment.
58
+
59
+ **Observation**:
60
+ - Lowest education levels (1 and 2) have the highest diabetes prevalence (~30%).
61
+ - Highest education levels (5 and 6) show significantly lower prevalence.
62
+ - Reinforces the finding from the income analysis: socio-economic factors are strong, interconnected predictors.
63
+
64
+ **Education vs Diabetes Visualization**:
65
+ ![Education vs Diabetes](education.png)
66
+
67
+
68
+ ## 4.3 Lifestyle Factors: Smoking and Physical Activity
69
+
70
+ - **Objective**: Evaluate how key lifestyle factors affect diabetes prevalence.
71
+ - **Factors Analyzed**: Smoking status and regular physical activity.
72
+ - **Visualization**: Side-by-side bar plots comparing diabetes prevalence by smoking status and physical activity.
73
+
74
+ **Observations**:
75
+ - Smokers have a higher diabetes rate than non-smokers.
76
+ - Physically active individuals have a substantially lower diabetes rate.
77
+ - Confirms that harmful habits increase risk while healthy behaviors are protective.
78
+
79
+ **Visualization**:
80
+ ![Smoking and Physical Activity](smokingandphysical.png)
81
+
82
+
83
+ ## 4.4 Physiological Factor: Body Mass Index (BMI)
84
+
85
+ - **Objective**: Examine BMI distributions by diabetes status.
86
+ - **Visualization**: Box plot comparing BMI between diabetic and non-diabetic individuals.
87
+ - **Reference**: Horizontal line at BMI = 30 (obesity threshold).
88
+
89
+ **Observations**:
90
+ - Diabetic individuals have a substantially higher median BMI than non-diabetics.
91
+ - Most diabetic individuals lie above BMI 30, confirming BMI as a high-impact predictor.
92
+ - The distributions are well separated, indicating BMI is highly discriminative.
93
+
94
+ **Visualization**:
95
+ ![BMI Distribution](BMI.png)
96
+
97
+
98
+ ## 4.5 Physiological Factor: Age
99
+
100
+ - **Objective**: Compare age distributions between diabetic and non-diabetic individuals.
101
+ - **Visualization**: Box plot of age by diabetes status.
102
+
103
+ **Observations**:
104
+ - Diabetic individuals are older on average, with a wider upper quartile.
105
+ - Non-diabetics are younger, with a tighter distribution.
106
+ - Age is an important demographic predictor of diabetes.
107
+
108
+ **Visualization**:
109
+ ![Age Distribution](Age.png)
110
+
111
+
112
+ ## 5.1 Logistic Regression: Balanced Training
113
+
114
+ - **Objective**: Train a Logistic Regression model on **balanced and scaled training data** to address class imbalance.
115
+ - **Evaluation**: Tested on the original (unbalanced) test set.
116
+ - **Metrics**: Confusion matrix, classification report (precision, recall, F1-score), and ROC AUC score.
117
+
118
+ **Key Insights**:
119
+ - Balancing the training data improves recall for the diabetic class, reducing false negatives.
120
+ - F1-score shows improved balance between precision and recall for minority class.
121
+ - ROC AUC confirms strong discriminative power of the model.
122
+ - Suggests Logistic Regression is an effective baseline; further exploration with non-linear models could improve performance.
123
+
124
+
125
+ ## 5.2 ROC Curve and AUC Analysis
126
+
127
+ - **Objective**: Visualize model performance and evaluate discriminative power using the ROC curve.
128
+ - **Visualization**: Orange line = model performance; Blue diagonal = random classifier baseline (AUC = 0.50).
129
+
130
+ **Observation**:
131
+ - The model’s ROC curve lies well above the baseline, confirming strong discriminative ability.
132
+ - Final AUC score quantitatively supports model effectiveness.
133
+ - Confirms that balancing the training data yields a robust baseline model for diabetes prediction.
134
+
135
+ **Visualization**:
136
+ ![ROC Logistic Regression](ROC_Logistic_Regression.png)
137
+
138
+
139
+ ## Final Insights
140
+
141
+ - Socio-economic factors (Income, Education) are strongly correlated with diabetes prevalence.
142
+ - Lifestyle factors such as Smoking and Physical Activity significantly influence diabetes risk.
143
+ - Physiological factors (BMI, Age) are dominant predictors.
144
+ - Logistic Regression trained on balanced data provides a robust and interpretable baseline model.
145
+ - Future work could include testing non-linear models, ensemble methods, or feature engineering to further improve predictive performance.
146
+
147
+
148
+ ## How to Use This Dataset and Notebook
149
+
150
+ - The dataset can be used to explore health, lifestyle, and socio-economic predictors of diabetes.
151
+ - The notebook provides step-by-step EDA and visualization examples.
152
+ - Logistic Regression serves as a baseline classification model.
153
+ - All plots are included and can be reused in reports or presentations.
devoir data/Untitled3 (5).ipynb ADDED
The diff for this file is too large to render. See raw diff
 
devoir data/classibalance (1).png ADDED

Git LFS Details

  • SHA256: e3b2a8b49c45a2ddb7434ebd7bd3cb8effda4388d7c38e8bc88b3e161d42bbc1
  • Pointer size: 130 Bytes
  • Size of remote file: 32.1 kB
devoir data/eucation (1).png ADDED

Git LFS Details

  • SHA256: c713c1bbc815224a5f5199bc27138654a3d3092d39018221ae8bbd7f648dd6ca
  • Pointer size: 130 Bytes
  • Size of remote file: 38.7 kB
devoir data/income (1).png ADDED

Git LFS Details

  • SHA256: ce006b38d97e311bbd2ecd303ae664ac31bc6a26f412fa6b7f7168354d4d7fb7
  • Pointer size: 130 Bytes
  • Size of remote file: 41.9 kB
devoir data/smokingandphysical (1).png ADDED

Git LFS Details

  • SHA256: a4d7e12d0b2245f40f5612d006121becc12348314405c565682f4b4367af74ed
  • Pointer size: 130 Bytes
  • Size of remote file: 55.9 kB