Sınıflandırma yöntemlerinin performansının üretilmiş ve gerçek veri setleri kullanılarak incelenmesi
Analyzing the performance of classification methods using generated and real datasets
Yazar: ÇİĞDEM KADAİFÇİ YANMAZ
Danışman: PROF. DR. EYLEM DENİZ HOWE
Mimar Sinan Güzel Sanatlar Üniversitesi / Fen Bilimleri Enstitüsü / İstatistik Ana Bilim Dalı / İstatistik Bilim Dalı
Derece: Yüksek Lisans, 2024
Konu: İstatistik = Statistics

Özet:
Bu çalışma kapsamında, gerçek hayatta karşılaşılan veri setlerinde sıklıkla yer alan aykırı gözlemler, gürültülü veri ve değişkenler arasında güçlü doğrusal ilişki durumlarına karşı, literatürde ve uygulamada yaygın şekilde kullanılan temel sınıflandırma yöntemlerinin nasıl performans gösterdiği incelenmiştir. Bu amaçla, çalışmanın birinci bölümünde, farklı sayıda gözlemler içeren üç adet dengeli (balanced) veri seti birbirinden bağımsız şekilde üretilmiştir. Yöntemlerin performansının, verinin değişen özelliklerine göre nasıl farklılık gösterdiğini inceleyebilmek amacıyla, üretilen her veri setindeki değişkenlerin çeşitli kombinasyonlarından oluşan 15 senaryo hazırlanmıştır. Farklı büyüklüklerdeki üç veri setinden elde edilen toplam 45 senaryo Lojistik Regresyon (Logistic Regression), Karar Ağacı (Decision Tree), Naïve Bayes ve Rassal Orman (Random Forest) yöntemleri kullanılarak incelenmiştir. Gerçek veri setlerinin dengesiz (imbalanced) olması, uygulamada sıklıkla karşılaşılan bir durumdur. Bu sebeple, üretilen veri setleri dengesiz olacak şekilde düzenlenerek, seçilen sınıflandırma yöntemlerinin performansı dengesiz veri durumunda, oluşturulan 45 senaryo üzerinden ayrıca incelenmiştir. 
Buna göre; veri setlerindeki gözlem sayısı az iken Lojistik Regresyon ve Naïve Bayes yöntemleri daha iyi sonuç verirken gürültü ve aykırı gözlemler sınıflandırma performansını yüksek oranda etkilemektedir. Veri setinin büyüklüğünden bağımsız olarak en iyi doğruluk performansı çoğunlukla Lojistik Regresyon ile elde edilmiştir. Tüm senaryolarda çoklu bağlantının varlığı sınıflandırma performansının yüksek olmasına yol açmıştır. Tüm değişken tiplerinin yer aldığı senaryolarda yöntemlerin doğruluk performansı daha yüksektir. 
Düşük örnekleme yaklaşımıyla dengesizleştirilen veri setlerinde gözlem sayısı ve veri setinin büyüklüğünden bağımsız olarak Lojistik Regresyon başarılı bir sınıflandırma yöntemi olarak öne çıkmıştır. Rassal Orman, gözlem sayısı düşükken aykırı gözlemler ve gürültü karşısında görece daha başarısız iken gözlem sayısı arttıkça bu tip değişkenler karşısında daha başarılı olmuştur.
Çalışmanın ikinci bölümünde, seçilen sınıflandırma yöntemlerinin gerçek bir veri setinde nasıl performans göstereceğini inceleyebilmek amacıyla, bir elektronik ticaret şirketinden yapılan alışverişlere ait veri gerçek kullanılarak satın alınan ürünlerin iade edilip edilmeyeceği tahminlenmiştir. Gerçek veri kullanıldığında tahmin doğruluk oranları Lojistik Regresyon ile %86,74 ve Rassal Orman ile %86,34 olarak görece yüksek elde edilmiştir. Lojistik Regresyon, en yüksek doğruluk performansı gösteren yöntemdir. Fakat duyarlılık ve kesinlik değerlerine bakıldığında, ağaç temelli yöntemlerden olan Karar Ağacı yönteminin sırasıyla %52,22 duyarlılık ve %60,48 kesinlik değeri; Rassal Orman yönteminin sırasıyla %52,25 duyarlılık ve %62,66 kesinlik değeri ile daha iyi performans gösterdiği görülmektedir. İade edilmeyen ürünlerin sayısı çok yüksek olduğundan, negatif sınıfların ne kadar iyi tahmin edebildiğini gösteren özgüllük değeri tüm yöntemler için çok yüksek elde edilmiş olup en iyi sonucu veren %99,78 değeriyle Lojistik Regresyon yöntemidir. 
Elektronik ticaret şirketine ait gerçek satış verisi, gürültü, eksik ve aykırı gözlemler ile bağımsız değişkenler arasında çoklu doğrusal bağlantının söz konusu olduğu dengesiz bir veri setidir. Bu dengesiz veri seti, seçilen sınıflandırma yöntemleriyle incelendikten sonra aşırı örnekleme (oversampling) ve düşük örnekleme (undersampling) yaklaşımlarıyla dengeli hale getirilerek sınıflandırma yöntemlerinin performansı karşılaştırmalı olarak incelenmiştir. Dengelenen veri setlerinde ağaç temelli bir yöntem olan Rassal Orman en iyi sınıflandırma performansını sergileyen yöntem olmuştur. Doğruluk, kesinlik ve F_1-skoru için en yüksek değerler Rassal Orman yöntemiyle elde edilirken, Karar Ağacı yönteminin özgüllük performansı, Naïve Bayes yönteminin ise duyarlılık performansı daha iyidir.

Abstract:
Classification problems have been the subject of various decision making problems across different industries, and several methods and algorithms have been developed to solve them. These problems are applied in a wide range of areas, such as disease diagnosis, credit risk assessment, and customer segmentation. The aim is to classify the dependent variable, which is the subject of the research question, into two or more groups in the most appropriate way using -multiple- independent variables.
Datasets for classification problems typically contain different types of variables (categorical and metric), each of which has characteristics that can affect the performance of classification models. Datasets may suffer from disruptive effects such as noise, missing data, outliers, and multicollinearity among independent variables, which can negatively impact the accuracy and generalizability of the models. Therefore, it is of great importance to understand the effects of such conditions on classification methods and to use appropriate approaches to minimize these effects.
The aim of this study is to observe how commonly used classification methods in the literature and practice respond to the presence of outliers, noise, and strong linear relationships between independent variables, which are frequently encountered in real-life datasets. For this purpose, in the first phase of this study, three independently generated balanced datasets of varying sizes were used. Fifteen scenarios, consisting of various combinations of variables from the generated datasets, were prepared to examine how the performance of these methods varies with changing data characteristics. In total, 45 scenarios derived from three datasets of different size were analyzed using Logistic Regression, Decision Tree, Naïve Bayes, and Random Forest methods. The generated datasets were examined both separately and comparatively based on their accuracy performances for common findings. Since the real dataset examined in the second phase of this study was imbalanced, the generated datasets were adjusted to be imbalanced, and the performance of the selected classification methods was also examined in 45 scenarios under imbalanced data conditions.
Accordingly, Logistic Regression and Naïve Bayes methods yielded better results when the number of observations in the datasets was low, while noise and outliers significantly affected classification performance. Naïve Bayes performed better with a smaller dataset, whereas Logistic Regression performed better with a larger dataset. Regardless of the size of dataset, the best accuracy performance was mostly obtained with Logistic Regression. The presence of multicollinearity in all scenarios led to high classification performance. The accuracies of the methods were significantly higher in scenarios that incorporated all types of variables.
In datasets imbalanced with an undersampling approach, Logistic Regression emerged as a successful classification method regardless of the number of observations and dataset size. When the number of observations was low, Decision Tree method demonstrated better accuracy performance than did the analysis with balanced data. Random Forest performed poorly against outliers and noise when the number of observations was low but improved as the number of observations increased.
To examine how the selected classification methods would perform on a real dataset, a dataset from an e-commerce company was used to predict whether purchased products would be returned. Product returns are considered an important and difficult problem to manage in e-commerce. High return rates can significantly impact the seller's profitability, lead to additional costs such as restocking, undermining customer satisfaction and trust, negatively affecting customer loyalty, and thereby reducing future sales, and resulting in the inability to accurately forecast sales or meet customer demands. Operationally, managing returns requires additional time, labor, and infrastructure, which can disrupt the seller's other operations. Finally, high return rates can negatively impact the environment by increasing carbon emissions through reverse logistics activities or by causing waste and pollution through disposing of unsold products. 
Effectively managing product returns in e-commerce activities will contribute to financial performance and customer satisfaction, enable optimal resource allocation and inventory management, and reduce negative environmental impacts. The most effective way to manage these returns is to predict the reasons for returns and the likelihood of product sales turning into returns; that is, to make a quantitative assessment using return data.
By applying the classification methods using real sales data from an e-commerce company, the prediction accuracy rates were 86.73% with Logistic Regression, 86.07% with Decision Tree, 84.72% with Naïve Bayes, and 86.35% with Random Forest. Logistic Regression exhibited the highest accuracy. Due to the high number of non-returned products, the specificity value, which indicates how accurately the negative classes are predicted, was exceptionally high for all methods. Logistic Regression achieved the highest specificity value at 99.78%. However, in terms of the precision and recall values, the tree-based methods showed better performance: Decision Tree achieved 52.22% recall and 60.48% precision, whereas Random Forest achieved 52.25% recall and a 62.66% precision. The F_1-score was 51.50% for both tree-based methods, which was higher than that of the other methods.
With the real dataset balanced using the oversampling approach, the performance of Logistic Regression decreased across all indicators, while the tree-based methods Random Forest and Decision Tree emerged as the most successful classification methods. Accuracy rates were 60.41% with Logistic Regression, 71.77% with Decision Tree, 60.12% with Naïve Bayes, and 72.56% with Random Forest. The ability to detect negative classes decreased with data balancing, but Decision Tree (69.73%) and Random Forest (69.95%) performed better than other classification methods. Recall and precision values were quite low for Logistic Regression, while Random Forest showed the best performance. In terms of measures obtained from balancing the real dataset with the undersampling approach, there was no change in the performance of Logistic Regression and Naïve Bayes compared to the oversampling balanced state. The highest values for accuracy, precision, and F1-score were obtained with the Random Forest method, while the Decision Tree method showed better specificity performance, and the Naïve Bayes method showed better recall performance.
The findings offer valuable insights into how basic classification methods perform and how their performance varies with the presence of different variable characteristics in datasets. Additionally, these findings provide practical guidance for e-commerce managers in predicting product returns. By applying effective classification methods, managers can identify patterns and factors that can lead to returns. This enables proactive measures to reduce return rates, such as improving product descriptions, implementing quality management strategies, or adjusting return policies, ultimately enhancing customer experiences.
The most significant limitation of this study is that the datasets used in the first phase were generated from a multivariate normal distribution. This may have led to higher performance indicators, especially in scenarios with all variables and a high number of observations. Future studies can address the same research question using datasets containing variables from different distributions. While this study examined the performance of the classical classification methods, it did not compare them with other tree-based algorithms such as Light Gradient Boosting and Extreme Gradient Boosting, which have been shown to be successful in similar classification problems in the literature. Future research should focus on examining the performance of the selected methods by expanding the set of independent variables in real data with metric or categorical variables and observing potential improvements in performance indicators such as precision and recall.