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
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
Heart Disease (Cleveland) Instances: 303 Attributes: 14 out of 76 Type: categorical, numeric, integer Data Type: continuous, discrete
Exploratory Data Analysis
Exploratory Data Analysis 1. Barplot 2. Pairplot 3. Boxplot 4. Heatmap
Results
Results H UH
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)
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
Classifiers
Classifiers 1. Logistic regression 2. Boosted Logistic regression 3. Random forest 4. K-nearest neighbour
Logistic regression
Logistic regression ● A logistic regression model is used ● Model improvement by error minimization
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
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
kNN ● A new datapoint is classified by looking at the k nearest neighbors ● Best tuned model → k = 13
The amount of agreement correct by the agreement expected by chance is Cohen’s Kappa
ROC curves of logistic regression (AUC-ROC 0.89), random forest (0.9), boosted logistic regression (0.88) and kNN (0.89)
Precision: Recall:
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
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 ?
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
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
Accuracy ⇒ Downward trend Possible reason: Tuning parameters mtry (by default) → bagging Fast Good variance-bias tradeoff nIter (by default) → decision stump Speedy Weak