Introduction to Focus Areas Data Science WS22/23 Project 1

Slide 1 of 27: Introduction to Focus Areas Data Science WS22/23 Project 1
Instructor: Prof. Dr. Katharina Jahn Introduction to Focus Areas Data Science WS22/23 Project 1 Group 7 Maike, Jule, Carlos, Abhinav

Goals

Slide 2 of 27: Goals
Goals 1. Exploratory data analysis 2. Classification 3. Performance metrics

Heart Disease (Cleveland) Instances: 303 Attributes: 14 out of 76 Type: categorical, numeric, integer Data Type: continu

Slide 3 of 27: Heart Disease (Cleveland) Instances: 303 Attributes: 14 out of 76 Type: categorical, numeric, integer Data Type: continu
Heart Disease (Cleveland) Instances: 303 Attributes: 14 out of 76 Type: categorical, numeric, integer Data Type: continuous, discrete

Exploratory Data Analysis

Slide 4 of 27: Exploratory Data Analysis
Exploratory Data Analysis 1. Barplot 2. Pairplot 3. Boxplot 4. Heatmap

Results

Slide 5 of 27: Results
Results H UH

Pairs plot of cp, ca, thal and thalach by goal (healthy, unhealthy): density curves, scatter plots and correlations

Slide 6 of 27: Pairs plot of cp, ca, thal and thalach by goal (healthy, unhealthy): density curves, scatter plots and correlations

Effect of categorical variables: bar charts of chest pain type, exercise-induced angina, fasting blood sugar, peak exercise ST segment, resting ECG, sex and thalassemia, by heart disease (no, yes)

Slide 7 of 27: Effect of categorical variables: bar charts of chest pain type, exercise-induced angina, fasting blood sugar, peak exercise ST segment, resting ECG, sex and thalassemia, by heart disease (no, yes)

Boxplots for numeric variables: age, max heart rate achieved, number of major vessels, resting blood pressure, serum cholesterol and ST depression, by heart disease (no, yes)

Slide 8 of 27: Boxplots for numeric variables: age, max heart rate achieved, number of major vessels, resting blood pressure, serum cholesterol and ST depression, by heart disease (no, yes)

Heat map of Pearson correlations between age, resting blood pressure, serum cholesterol, max heart rate, ST depression, number of major vessels and thalassemia

Slide 9 of 27: Heat map of Pearson correlations between age, resting blood pressure, serum cholesterol, max heart rate, ST depression, number of major vessels and thalassemia

Classifiers

Slide 10 of 27: Classifiers
Classifiers 1. Logistic regression 2. Boosted Logistic regression 3. Random forest 4. K-nearest neighbour

Logistic regression

Slide 11 of 27: Logistic regression
Logistic regression ● A logistic regression model is used ● Model improvement by error minimization

Boosted Logistic regression

Slide 12 of 27: Boosted Logistic regression
Boosted Logistic regression First classification based on each feature separately (decision stumps) Combining of the classifications by applying different weights and a logistic regression

Random Forest

Slide 13 of 27: Random Forest
Random Forest Multiple Decision Trees are randomly created A data point is classified by each of them The class with the most ‘votes’ is the final classification

kNN

Slide 14 of 27: kNN
kNN ● A new datapoint is classified by looking at the k nearest neighbors ● Best tuned model → k = 13

Performance Metrics

Slide 15 of 27: Performance Metrics
Performance Metrics 1. Accuracy dotplot 2. Comparison graph 3. PR curve 4. PRG curve 5. ROC curve 6. Calibration curve

The amount of agreement correct by the agreement expected by chance is Cohen’s Kappa

Slide 16 of 27: The amount of agreement correct by the agreement expected by chance is Cohen’s Kappa

Performance chart: sensitivity, specificity and accuracy of kNN, boosted logistic regression, random forest and logistic regression, with each model’s optimal informedness

Slide 17 of 27: Performance chart: sensitivity, specificity and accuracy of kNN, boosted logistic regression, random forest and logistic regression, with each model's optimal informedness

ROC curves of logistic regression (AUC-ROC 0.89), random forest (0.9), boosted logistic regression (0.88) and kNN (0.89)

Slide 18 of 27: ROC curves of logistic regression (AUC-ROC 0.89), random forest (0.9), boosted logistic regression (0.88) and kNN (0.89)

Precision: Recall:

Slide 19 of 27: Precision: Recall:

Formulas for precision gain (precG) and recall gain (recG)

Slide 20 of 27: Formulas for precision gain (precG) and recall gain (recG)

Precision-recall-gain curves of logistic regression (AUC-PRG 0.48), random forest (0.51), boosted logistic regression (0.44) and kNN (0.45)

Slide 21 of 27: Precision-recall-gain curves of logistic regression (AUC-PRG 0.48), random forest (0.51), boosted logistic regression (0.44) and kNN (0.45)

Calibration plot: true probability in each bin against predicted probability for logistic regression, random forest, boosted logistic regression and kNN

Slide 22 of 27: Calibration plot: true probability in each bin against predicted probability for logistic regression, random forest, boosted logistic regression and kNN

References

Slide 23 of 27: References
References Pisula T. “An Ensemble Classifier-Based Scoring Model for Predicting Bankruptcy of Polish Companies in the Podkarpackie Voivodeship.” Journal of Risk and Financial Management. 2020; 13(2):37. https://doi.org/10.3390/jrfm13020037. Detrano, R et al. “International application of a new probability algorithm for the diagnosis of coronary artery disease.” The American journal of cardiology vol. 64,5 (1989): 304-10. https://doi.org/10.1016/0002-9149(89)90524-9. J. H. Gennari, P. Langley, and D. Fisher. 1989. “Models of incremental concept formation.” Artif. Intell. 40, 1–3 (Sep. 1989), 11–61. https://doi.org/10.1016/0004-3702(89)90046-5 Kibler, Dennis, David W. Aha, and Marc K. Albert. "Instance‐based prediction of real‐valued attributes." Computational Intelligence 5.2 (1989): 51-57. R Core Team (2022). “R: A language and environment for statistical computing.” R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/. Illustrations https://www.researchgate.net/figure/Data-classification-by-logistic-regression-aClassification -of-1D-data-showing-the-fitted_fig1_353913155 Random Forest sketch https://www.researchgate.net/figure/Example-of-a-Random-Forest-workflow_fig2_3420288 Dataset description can be found here , and data file here.

Thanks for listening! Questions ?

Slide 24 of 27: Thanks for listening! Questions ?

Heat map of Kendall correlations between age, resting blood pressure, serum cholesterol, max heart rate, ST depression, number of major vessels and thalassemia

Slide 25 of 27: Heat map of Kendall correlations between age, resting blood pressure, serum cholesterol, max heart rate, ST depression, number of major vessels and thalassemia

Top features: chest pain type (cp), number of major vessels (ca), maximum heart rate achieved (thalach), thallium scinti

Slide 26 of 27: Top features: chest pain type (cp), number of major vessels (ca), maximum heart rate achieved (thalach), thallium scinti
Top features: chest pain type (cp), number of major vessels (ca), maximum heart rate achieved (thalach), thallium scintigraphy (thal)

Accuracy ⇒ Downward trend Possible reason: Tuning parameters mtry (by default) → bagging Fast Good variance-bias tradeof

Slide 27 of 27: Accuracy ⇒ Downward trend Possible reason: Tuning parameters mtry (by default) → bagging Fast Good variance-bias tradeof
Accuracy ⇒ Downward trend Possible reason: Tuning parameters mtry (by default) → bagging Fast Good variance-bias tradeoff nIter (by default) → decision stump Speedy Weak