استراتيجيات اختيار الميزات: تحليل مقارن لطرق قيمة SHAP والطرق المعتمدة على الأهمية Feature selection strategies: a comparative analysis of SHAP-value and importance-based methods
استراتيجيات اختيار الميزات: تحليل مقارن لطرق قيمة SHAP والطرق المعتمدة على الأهمية
هوانجينغ وانغكيانشين ليانغجون ت. هانكوك² وتاغي م. خوشغفتار²
*المراسلات: huanjing.wang@wku.edu كلية أوجدن للعلوم والهندسة، جامعة ويسترن كنتاكي، بولينغ غرين، الولايات المتحدة الأمريكية كلية الهندسة وعلوم الحاسوب، جامعة فلوريدا أتلانتيك، بوكا راتون، الولايات المتحدة الأمريكية
الملخص
في سياق بيانات الاحتيال ببطاقات الائتمان عالية الأبعاد، يستخدم الباحثون والممارسون تقنيات اختيار الميزات لتعزيز أداء نماذج اكتشاف الاحتيال. تقدم هذه الدراسة مقارنة في أداء النموذج باستخدام أهم الميزات التي تم اختيارها بواسطة قيم SHAP (التفسيرات الإضافية لشابلي) وقائمة أهمية الميزات المدمجة في النموذج. تقوم كلا الطريقتين بتصنيف الميزات واختيار الأكثر أهمية لتقييم النموذج. لتقييم فعالية هذه التقنيات في اختيار الميزات، تم بناء نماذج تصنيف باستخدام خمسة مصنفات: XGBoost، شجرة القرار، CatBoost، الأشجار العشوائية للغاية، وغابة عشوائية. تعتبر المساحة تحت منحنى الدقة والاسترجاع (AUPRC) هي مقياس التقييم. تم تنفيذ جميع التجارب على مجموعة بيانات اكتشاف احتيال بطاقات الائتمان من كاجل. تشير النتائج التجريبية والاختبارات الإحصائية إلى أن طرق اختيار الميزات المستندة إلى قيم الأهمية تتفوق على تلك المستندة إلى قيم SHAP عبر المصنفات وأحجام مجموعات الميزات المختلفة. بالنسبة للنماذج المدربة على مجموعات بيانات أكبر، يُوصى باستخدام قائمة أهمية الميزات المدمجة في النموذج كطريقة اختيار الميزات الأساسية بدلاً من SHAP. تستند هذه الاقتراحات إلى المنطق القائل بأن حساب أهمية ميزات SHAP هو نشاط متميز، بينما توفر النماذج بشكل طبيعي أهمية الميزات المدمجة كجزء من عملية التدريب، مما يتطلب جهدًا إضافيًا أقل. وبالتالي، فإن اختيار قائمة أهمية الميزات المدمجة في النموذج يمكن أن يوفر نهجًا أكثر كفاءة وواقعية لمجموعات البيانات الأكبر والنماذج الأكثر تعقيدًا.
الكلمات الرئيسية: اختيار الميزات، عدم توازن الفئات، احتيال بطاقات الائتمان، SHAP، الميزة أهمية
مقدمة
كشف الاحتيال في بطاقات الائتمان أمر بالغ الأهمية في صناعة المالية ويعتمد بشكل كبير على المعلومات المخزنة في مجموعات بيانات المعاملات. ومع ذلك، تواجه مجال المالية وتعلم الآلة تحديًا بحثيًا كبيرًا بسبب جودة البيانات، حيث تؤثر بشكل مباشر على القرارات المتخذة أثناء النمذجة والتحليل.لمعالجة هذه المشكلة، نتعمق في فضاء الميزات المتاحة، مستخرجين مجموعة مناسبة من الميزات. وهذا يبرز أهمية اختيار الميزات كخطوة أساسية في تنظيف البيانات قبل الانخراط في أي عملية نمذجة. لقد تم تطبيق اختيار الميزات في مجالات متنوعة السياقات ضمن تنقيب البيانات وتعلم الآلة، بهدف إزالة الميزات غير ذات الصلة أو المكررة من التحليل. وهذا لا يؤدي فقط إلى تسريع تدريب النموذج ولكن أيضًا يعزز أداء المصنف.
تتناول هذه الدراسة مقارنة بين طريقتين لاختيار الميزات: اختيار القيم المستندة إلى تفسير شابلي الإضافي (SHAP) [3] واختيار المستند إلى الأهمية المستخدم بشكل شائع [4، 5]. يستفيد SHAP من مفاهيم نظرية الألعاب لحساب أهمية الميزات في خطوتين: تدريب نموذج تصنيف باستخدام جميع الميزات في التفاعل الأولي، ثم حساب قيم SHAP لكل ميزة، وبعد ذلك ترتيبها لتحديد الميزات الأكثر أهمية لنمذجة المشكلة المستهدفة. من ناحية أخرى، يقوم الاختيار المستند إلى الأهمية بحساب أهمية الميزات لجميع الميزات خلال عملية تدريب النموذج. كلا الطريقتين مدمجتان حيث إنهما تتضمنان عملية بناء النموذج. في عملية اختيار الميزات لدينا، نستخدم خمسة متعلمين: تعزيز التدرج المتطرف (XGBoost) [6]، شجرة القرار (DT) [7]، كات بوست (CatBoost) [8]، الأشجار العشوائية بشكل متطرف (ET) [9]، وغابة عشوائية (RF) [10]. تم اختيار هؤلاء المتعلمين الخمسة بناءً على قدرتهم على توليد قائمة ترتيب الأهمية خلال عملية بناء النموذج. لم يتم تضمين LightGBM [11] في خياراتنا بسبب أدائه الضعيف، كما تشير نتائجنا الأولية مقارنةً بالمتعلمين الآخرين. لقد قمنا بتسمية الطرق المستندة إلى قيم SHAP باسم SHAP-XGBoost، SHAP-DT، SHAP-CatBoost، SHAP-ET، وSHAP-RF، بينما نشير إلى الطرق المستندة إلى الأهمية ببساطة باسم XGBoost، DT، CatBoost، ET، وRF. في المجموع، هناك 10 طرق لاختيار الميزات، خمسة من كل فئة.
لإجراء دراستنا، نركز على مجموعة بيانات كشف الاحتيال باستخدام بطاقات الائتمان، وهي مجموعة من المعاملات المالية المجهولة المتاحة على كاجل [12]. هذه المجموعة هي الوحيدة المتاحة للجمهور والتي تحتوي على بيانات كبيرة لتحليل احتيال بطاقات الائتمان. وبالتالي، فإن نطاق الدراسة محدود بمجموعة بيانات واحدة. تحتوي على 284,807 معاملة و30 ميزة مستقلة، فقط 492 (تُصنف السجلات على أنها احتيالية. باستخدام طريقتين مختلفتين لاختيار الميزات، نقيم أداء خمس مجموعات من نماذج المصنفات باستخدام تقنيات اختيار ميزات مختلفة (SHAP-XGBoost مقابل XGBoost، SHAP-DT مقابل DT، SHAP-CatBoost مقابل CatBoost، SHAP-ET مقابل ET، وSHAP-RF مقابل RF) مع الميزات المختارة الخاصة بها. يتم اختيار أفضل 3، 5، 7، 10، و15 ميزة بناءً على درجاتها الخاصة. من أجل التصنيف، نبني نماذج كشف احتيال بطاقات الائتمان باستخدام المصنفات الخمسة، وهي نفس النماذج المستخدمة في اختيار الميزات. يتم تقييم المصنفات باستخدام مقياس منطقة تحت منحنى الدقة والاسترجاع (AUPRC) [13]، ونقوم أيضًا بإجراء اختبار إحصائي بمستوى دلالة لتقييم الدلالة الإحصائية لنتائجنا.
حسب علمنا، هذه الدراسة هي أول تحقيق تجريبي شامل يقارن بين أداء اختيار الميزات القائم على قيمة SHAP واختيار الميزات القائم على الأهمية في سياق اكتشاف الاحتيال وربما مجالات تطبيق أخرى في تعلم الآلة.
يتكون باقي الورقة على النحو التالي. نبدأ بمراجعة للأعمال ذات الصلة، والتي تظهر جدّة البحث الذي نقدمه هنا. بعد ذلك نقدم المنهجية المستخدمة في التجربة، بما في ذلك تفسيرات لطريقتين لاستخراج الميزات، والمصنفات، والتحقق المتبادل، ومقياس الأداء. ثم نصف مجموعات البيانات، وتصميم التجربة، ونتائج التجربة. أخيرًا، نختم المقال بأهم النقاط الرئيسية لهذه الدراسة، ونقدم اقتراحات للعمل المستقبلي.
الأعمال ذات الصلة
اختيار الميزات هو تقنية مستخدمة على نطاق واسع في تطبيقات تعدين البيانات وتعلم الآلة. الهدف الرئيسي منها هو تحديد مجموعة فرعية من الميزات التي تقلل من أخطاء التنبؤ للمصنفات. في هذه الدراسة، قمنا بإجراء مراجعة شاملة للأدبيات المتعلقة بالأبحاث التي تستخدم إما قيم SHapley Additive exPlanations (SHAP) أو قائمة أهمية الميزات المدمجة في النموذج لاختيار الميزات. بينما وجدنا عددًا محدودًا من الدراسات التي استخدمت قائمة أهمية الميزات المدمجة في النموذج لاختيار الميزات في سياق مجموعة بيانات كشف احتيال بطاقات الائتمان، لم نصادف أي دراسات استخدمت SHAP لاختيار الميزات بشكل محدد في كشف احتيال بطاقات الائتمان. بدلاً من ذلك، وجدنا بعض الدراسات التي طبقت SHAP لاختيار الميزات في مجالات تطبيقية أخرى. علاوة على ذلك، لم نصادف أي دراسات قارنت مباشرة بين أداء النماذج المبنية باستخدام ميزات مختارة بواسطة أهمية ميزات SHAP مقابل النماذج المبنية باستخدام ميزات مختارة بواسطة أهمية الميزات المدمجة. لذلك، تقدم دراستنا مساهمة فريدة في مجال كشف احتيال بطاقات الائتمان، حيث تستكشف المقارنة بين SHAP وقائمة أهمية الميزات المدمجة في النموذج لاختيار الميزات، وهو منظور لم يتم استكشافه بشكل موسع في الأدبيات الحالية.
طبق رتايلي وإننيا [14] طريقة اختيار الميزات تحت الإشراف، الغابة العشوائية، لتحديد الميزات الأكثر تنبؤًا. الغابة العشوائية (RF) هي خوارزمية تعلم جماعي يتم تدريبها بشكل متوازي من خلال التجميع [15]. مؤخرًا، تم استغلال RF بشكل متزايد كطريقة لاختيار الميزات لأنها يمكن أن تتعامل مع مجموعات بيانات معقدة وعالية الأبعاد ويمكنها اكتشاف التفاعلات بين الميزات. كما أنها تقلل من خطر الإفراط في التكيف، الذي يحدث عندما تكون النموذج معقدًا جدًا ويتناسب بشكل وثيق مع بيانات التدريب. علاوة على ذلك، تحسب RF أهمية الميزات من خلال قياس الانخفاض في نقاء العقدة عند استخدام الميزة للتقسيم. كلما انخفضت الشوائب، اعتبرت الميزة أكثر أهمية. من خلال تصنيف الميزات بناءً على أهميتها، يمكن لـ RF المساعدة في اختيار الميزات الأكثر صلة بمهمة التصنيف. بعد اختيار مجموعة فرعية من الميزات من مجموعة بيانات كشف احتيال بطاقات الائتمان، قام المؤلفون بتشغيل آلة الدعم الشعاعي للعثور على المعاملات الاحتيالية. حقق النموذج دقة قدرهاحساسية لـ، وبلغت قيمة AUC 0.91، متفوقة على ثلاثة نماذج أخرى (غابة العزل، شجرة القرار، وعامل الشذوذ المحلي). الدراسة لا تقدم معلومات واضحة بشأن عدد الميزات المختارة. بالإضافة إلى ذلك، لم يقم المؤلفون بإجراء مقارنة بين أداء الميزات المختارة واستخدام جميع الميزات المتاحة. علاوة على ذلك، من الجدير بالذكر أن استخدام AUC كمقياس لتصنيف البيانات غير المتوازنة قد وُجد أنه مضلل [16].
في دراستهم باستخدام مجموعة بيانات كشف الاحتيال ببطاقات الائتمان [12]، قام روسلي وآخرون [17] أولاً بتصفية البيانات التي كانت لديها درجة z أكبر من أو تساوي 3 ثم قاموا بتطبيع البيانات المتبقية باستخدام مقياس الحد الأدنى والحد الأقصى. بعد ذلك، استخدموا بوروتا لحساب درجة أهمية كل ميزة. بوروتا [18] هو خوارزمية اختيار ميزات تحت إشراف مصممة كغلاف حول مصنف الغابة العشوائية لتحديد الميزات المهمة في مجموعة البيانات. احتفظوا بالميزات التي كانت لديها درجة أهمية 0.5 أو أعلى لتدريب الأوتوإنكودر في كل تكرار. اكتشف النموذج احتيال بطاقات الائتمان من خلال تحديد عتبة في خطأ إعادة البناء لتصنيف المعاملات على أنها شرعية أو احتيالية. ومع ذلك، فإن عدد الميزات المختارة في لم يتم تحديد خطوة المعالجة المسبقة من قبل المؤلفين. قام المؤلفون بتقييم النماذج باستخدام الدقة، والتميز، والاسترجاع، ودرجة F1. عند العمل مع مجموعات بيانات تظهر عدم توازن كبير في الفئات، قد لا تكون هذه المقاييس مناسبة بسبب الحجم الكبير لفئة الأغلبية.
يستخدم وسبادا وآخرون [4] مصنف RF لحساب درجة أهمية كل ميزة. يتمdiscard الميزات ذات درجة الأهمية المنخفضة. تسرد الورقة درجة الأهمية لجميع الميزات. يقوم المؤلفون بتحليل عدة عوامل (نسبة تقسيم مجموعة البيانات، اختيار أفضل k ميزات، كمية بيانات الاحتيال في بيانات التدريب، وضبط قيم المعلمات الفائقة) التي تؤثر على أداء نموذج Isolation Forest (IF) لاكتشاف الاحتيال في معاملات بطاقات الائتمان. يعتبر Isolation Forest طريقة شائعة لاكتشاف القيم الشاذة غير الخاضعة للإشراف. تشير نتائجهم إلى أن أفضل النتائج يمكن الحصول عليها من خلال ضبط نسبة التدريب إلى الاختبار لـ، باستخدام أفضل خمس ميزات ( )، باستخدام فقط بيانات الاحتيال، وضبط المعلمات الفائقة مع عدد الأشجار 100، وعينة قصوى 128، و0.001 تلوث. يظهر النموذج نتائج مثيرة للإعجاب حيث حقق دقةاستدعاءدرجة F1 لـمساحة تحت منحنى خصائص التشغيل المستقبلية (AUC) تبلغ 0.97371، ومساحة تحت منحنى الدقة والاسترجاع (AUPRC) تبلغ 0.759228. استخدم وسبادا وآخرون طريقة واحدة فقط لاختيار الميزات المعتمدة على الأهمية ولم يدمجوا SHAP لاختيار الميزات، وهو ما قمنا بتنفيذه في دراستنا.
في دراستهم، استخدم ليو وآخرون [19] SHAP لاختيار الميزات على مجموعة بيانات مرض باركنسون الطبية من UCI [20]. قاموا بدمج قيم SHAP مع أربعة مصنفات: الغابة العميقة (gcForest)، تعزيز التدرج المتطرف (XGBoost)، آلة تعزيز التدرج الخفيف (LightGBM)، والغابة العشوائية (RF). تم استخدام كل مصنف لحساب قيم SHAP للميزات الفردية. لتقييم فعالية اختيار الميزات باستخدام SHAP، قاموا بمقارنته مع ثلاث طرق لاختيار الميزات تعتمد على الفلترة: Fscore، تحليل التباين (Anova-F)، والمعلومات المتبادلة. تم إجراء التجارب بنسبة تدريب واختبار تبلغ 70:30، وتم تطبيق اختيار الميزات على مجموعة بيانات التدريب. أظهرت النتائج أن نموذج gcForest المستند إلى اختيار الميزات بقيم SHAP حقق دقة تصنيف مثيرة للإعجاب منودرجة F1 تبلغ 0.945، مع اختيار 150 ميزة. وقد تفوقت هذه الأداء على نتائج طرق اختيار الميزات الأخرى التي تم النظر فيها في دراستهم. بينما استخدم المؤلفون بشكل محدد اختيار الميزات المعتمد على قيمة SHAP على مجموعة بيانات التدريب، استخدمنا طريقة SHAP عبر مجموعة البيانات بأكملها ثم أجرينا التحقق المتقاطع بعد إجراء اختيار الميزات.
استخدم مارسيليو وإيلر [21] طريقة SHAP ك técnica لاختيار الميزات وقارنوها بثلاث طرق شائعة الاستخدام لاختيار الميزات: المعلومات المتبادلة، الإزالة التكرارية للميزات، وANOVA. تضمنت عملية SHAP استخدام XGBoost كنموذج أساسي. أجروا تجارب على خمسة مجموعات بيانات من UCI باستخدام مصنف XGBoost وثلاث مجموعات بيانات أخرى من UCI باستخدام مُنظم XGBoost. كشفت نتائج دراستهم أن SHAP تفوقت على الطرق الثلاث الشائعة الاستخدام من حيث مقياس منطقة تحت منحنى التشغيل الاستقبالي (AUC). ومع ذلك، لوحظ أن SHAP تتطلب وقتًا حسابيًا أكبر مقارنةً بطرق اختيار الميزات الأخرى. ومن الجدير بالذكر أن مجموعات البيانات المستخدمة في تجارب مارسيليو وإيلر ليست عالية الجودة. غير متوازن، وليس في مجال احتيال بطاقات الائتمان. بالإضافة إلى ذلك، فإن مجموعات البيانات أصغر بكثير من حيث الحجم مقارنة بمجموعة بيانات اكتشاف احتيال بطاقات الائتمان في كاجل، مما لفت انتباهنا.
في مراجعتنا للأدبيات، اكتشفنا أنه تم استخدام طريقة واحدة فقط لاختيار الميزات، سواء كانت قائمة على قيم SHAP أو الأهمية. ومن الجدير بالذكر أنه لم يتم تحديد أي بحث يقارن بين هاتين الطريقتين، لا سيما في مجال اكتشاف احتيال بطاقات الائتمان. من أجل سد هذه الفجوة، قامت دراستنا بإجراء تحليل مقارن لهاتين الطريقتين لاختيار الميزات، باستخدام خمسة متعلمين في كل نهج.
المنهجية
طرق اختيار الميزات المعتمدة على الأهمية
تستفيد طرق اختيار الميزات المعتمدة على الأهمية من أشجار القرار لتحديد الميزات ذات الصلة من مجموعة بيانات معينة. تمتلك هذه المصنفات المعتمدة على أشجار القرار، مثل تعزيز التدرج المتطرف (XGBoost) [6، 22]، والأشجار العشوائية للغاية (ET) [9]، وغابة عشوائية (RF) [23]، وكات بوست (CatBoost) [8]، وشجرة القرار [7]، قدرة مدمجة على تحديد أهمية الميزات أثناء ملاءمة النموذج في التعلم الآلي الخاضع للإشراف. وبالتالي، يمكنها تصنيف الميزات بناءً على أهميتها في مهام التصنيف، مما يجعلها قيمة لاختيار الميزات. من خلال التخلص من الميزات الأقل صلة والاحتفاظ بأهمها، يمكن إنشاء نماذج أكثر كفاءة ودقة.
في هذه الدراسة، تم استخدام خمس طرق لاختيار الميزات بناءً على الأهمية: XGBoost [22]، شجرة القرار (DT) [7]، CatBoost [8]، الأشجار العشوائية للغاية (ET) [9]، وغابة عشوائية (RF) [10].
تتميز خوارزميات XGBoost و CatBoost بأنها من أكثر خوارزميات تعزيز التدرج استخدامًا، حيث تستخدم كل منهما أساليب مختلفة لحساب درجات أهمية الميزات. بينما تقوم كلا الخوارزميات ببناء مجموعات من أشجار القرار، تختلف منهجياتها في اشتقاق درجات أهمية الميزات. في XGBoost، يتم حساب هذه الدرجات باستخدام طريقة “الكسب”، التي تقيم تأثير كل ميزة على أداء النموذج طوال عملية التعزيز. في المقابل، تحسب مجموعة CatBoost من أشجار القرار أهمية الميزات بناءً على تكرار استخدام ميزة ما للتقسيم والتحسين اللاحق في أداء النموذج الذي تم تحقيقه من خلال تلك التقسيمات.
مصنف شجرة القرار هو نوع من خوارزميات التعلم الآلي المستخدمة في مهام التصنيف. يقوم ببناء نموذج شجري يشبه القرارات ونتائجها المحتملة من خلال تقسيم البيانات بشكل متكرر بناءً على الميزات الأكثر معلوماتية في كل عقدة. تولد أشجار القرار درجات أهمية الميزات من خلال تقييم قدرتها على تقليل تلوث جيني (أو زيادة النقاء) داخل البيانات أثناء بناء الشجرة.
تشترك الأشجار العشوائية للغاية والغابات العشوائية، وكلاهما مستمد من مجموعات أشجار القرار، في مبادئ مشتركة مثل تلوث جيني ومتوسط الانخفاض في التلوث لقياس أهمية الميزات. ومع ذلك، تقدم الأشجار العشوائية للغاية عشوائية متزايدة في عملية اتخاذ القرار أثناء بناء الشجرة. يمكن أن تؤدي هذه العشوائية المضافة إلى درجات أهمية متباينة، مما قد يؤثر على التوازن بين تحيز النموذج وتباينه.
طرق اختيار الميزات المعتمدة على قيمة SHAP
تفسير شابلي الإضافي (SHAP)، الذي قدمه لوندبرغ ولي [3]، قد اكتسب شعبية كطريقة لتفسير توقعات نماذج التعلم الآلي. من خلال استخدام تقنيات نظرية الألعاب [24]، يوفر SHAP رؤى حول مساهمة كل ميزة في توقعات معينة. إنه ينتمي إلى عائلة من تقنيات نسبة الميزات الإضافية التي تظل غير مرتبطة بالنموذج، مما يجعلها قابلة للتطبيق عالميًا على نماذج التعلم الآلي والتعلم العميق المختلفة. تنسب هذه التقنيات الأهمية إلى ميزات الإدخال الفردية، مما يسهل فهم سلوك النموذج بشكل أفضل.
في سياق اختيار الميزات، تعمل الطرق المعتمدة على SHAP كما يلي: يتم تدريب نماذج التصنيف، مثل XGBoost وشجرة القرار في هذه الدراسة، على مجموعة البيانات الكاملة. بعد ذلك، يتم حساب قيم SHAP لكل حالة، ثم يتم تجميع هذه القيم عبر مجموعة البيانات لاشتقاق القيم المطلقة المتوسطة لكل ميزة. تصبح عملية حساب قيم SHAP معقدة حسابيًا بسبب هذه العملية. تشير قيمة SHAP المتوسطة إلى التأثير النموذجي لكل ميزة على توقعات النموذج عبر مجموعة البيانات الكاملة، بينما تمثل قيمة SHAP المطلقة أهمية الميزة، بغض النظر عن اتجاهها (إيجابي أو سلبي). من خلال فرز الميزات بناءً على قيم SHAP المطلقة المتوسطة بترتيب تنازلي، يتم تحديد الميزات ذات القيم الأعلى على أنها أكثر تأثيرًا في التأثير على توقعات النموذج.
التصنيف
في هذه الدراسة، تم بناء نماذج كشف احتيال بطاقات الائتمان باستخدام خمسة مصنفات مختلفة، وهي XGBoost [6]، وشجرة القرار (DT) [7]، و CatBoost [8]، والأشجار العشوائية للغاية (ET) [9]، والغابات العشوائية (RF) [10]. من بين هؤلاء المتعلمين الخمسة، تعتبر XGBoost و CatBoost و ET و RF مجموعات من مصنفات قائمة على أشجار القرار [25]. نحن نختار هؤلاء المتعلمين بناءً على أنهم فعالون للغاية في التعامل مع البيانات المعقدة وعالية الأبعاد ومعروفون بأدائهم الممتاز في مجموعة واسعة من مهام التصنيف [25].
تعتبر XGBoost و CatBoost جميعها أطر تعزيز التدرج التي تستخدم على نطاق واسع لمهام التعلم الآلي، وخاصة للتصنيف. من المعروف أن هذين الخوارزميتين فعالان للغاية ويقدمان توقعات دقيقة. ومع ذلك، قد يختلف الأداء اعتمادًا على مجموعة البيانات المحددة والمشكلة المطروحة. تعتبر XGBoost تحسينًا متقدمًا لطريقة مجموعة أشجار القرار المعززة (GBDT). تم تقديم GBDTs في البداية من قبل فريدمان في عام 2001 [26]. تعزز XGBoost GBDTs بطرق متعددة. أولاً، تستخدم دالة خسارة محسّنة أثناء التدريب تتضمن مصطلحًا إضافيًا للتنظيم، مما يمنع فعليًا الإفراط في التكيف. ثانيًا، تقدم XGBoost “خوارزمية تقريبية” لحساب التقسيمات في أشجار القرار المكونة، والتي تناسب البيئات الموزعة والحالات التي لا يمكن فيها تحميل مجموعة البيانات الكاملة في الذاكرة الرئيسية. علاوة على ذلك، تتضمن XGBoost خوارزمية متخصصة للتعامل مع البيانات المتناثرة، حيث تكون معظم القيم ثابتة تقريبًا مع انحرافات عرضية. تتيح ميزة “البحث عن تقسيمات واعية بالندرة” لـ XGBoost الاستفادة من البيانات المتناثرة بكفاءة. من ناحية أخرى، تُعرف CatBoost بمتانتها في التعامل مع الميزات الفئوية والقيم المفقودة، مما يجعلها مناسبة لمجموعات البيانات التي تحتوي على مثل هذه الخصائص. الخوارزمية الأساسية لـ CatBoost هي التعزيز المرتب، الذي يتضمن فرز الحالات المستخدمة بواسطة أشجار القرار.
بالمقابل، تعتمد XGBoost على مخطط كمي وزني ودالة تأخذ في الاعتبار الندرة. المخطط الكمي الوزني هو تقنية تقريبية لتعلم الأشجار [27] تُستخدم لعمليات الدمج والتقليم، بينما تتعامل الندرة مع القيم التي تكون إما صفرًا أو مفقودة.
قدم بريمان مفهوم Bagging في مجال التعلم الآلي في ورقة عام 1996 [28]. نظرًا لأن بحثنا يدور حول التصنيف الثنائي، فإن تركيزنا ينصب على أفكار بريمان حول Bagging المطبقة على التصنيف الثنائي. تعتبر الأشجار العشوائية للغاية (ET) والغابات العشوائية (RF) كلاهما خوارزميات تعلم جماعي تنتمي إلى عائلة طرق أشجار القرار المعتمدة على Bagging. تم تقديم Random Forest من قبل بريمان [10]. يبني Random Forest على مبدأ Bagging مع تحسين إضافي. في Random Forest، يتم بناء كل شجرة باستخدام مجموعة فرعية عشوائية من الميزات والعينات. تساعد هذه العشوائية في إزالة الترابط بين الأشجار وتقليل الإفراط في التكيف. توسع الأشجار العشوائية للغاية مفهوم Random Forest من خلال اختيار قيم لتقسيمات شجرة القرار بشكل عشوائي، مما قد يجعلها أكثر قوة وكفاءة حسابية في بعض السيناريوهات. يعتمد الاختيار بين الاثنين غالبًا على الخصائص المحددة للبيانات والتوازن المطلوب بين التحيز والتباين. نتجاوز المعلومات التفصيلية حول هؤلاء المتعلمين ويُشار إلى القراء إلى [25].
شجرة القرار (DT) هي خوارزمية تعلم آلي تحت إشراف مستخدمة على نطاق واسع، وتطبق بشكل بارز على مهام التصنيف والانحدار. إنها نموذج غير خطي يقوم بتقسيم بيانات الإدخال بشكل متكرر إلى مجموعات فرعية بناءً على قيم الميزات. تمثل كل عقدة في شجرة القرار قرارًا بناءً على ميزة معينة وعتبة، مما يسهل التوقعات بناءً على قيم ميزات بيانات الإدخال. هيكل شجرة القرار الناتج قابل للتفسير للغاية، حيث تمثل كل عقدة داخلية قرارًا قائمًا على ميزة، وتوضح الحواف النتائج، وتوفر العقد الورقية التوقعات.
لضمان قابلية تكرار نتائجنا، قمنا بتعديل إعدادات بعض المعلمات الفائقة من قيمها الافتراضية كما هو مدرج في الجدول 1. علاوة على ذلك، قمنا بتعيين بذور مولد الأرقام العشوائية لجميع المصنفات لضمان نتائج متسقة وقابلة للتكرار. تم ترك جميع الإعدادات الأخرى على قيمها الافتراضية. تم توجيه تحديد أعماق الأشجار من خلال التجارب السابقة الموثقة في [1]، بهدف تحقيق توازن مناسب بين التقاط الأنماط المعقدة في البيانات وتقليل الإفراط في التكيف.
الجدول 1 إعدادات المعلمات الفائقة المستخدمة في التجارب
المصنف
اسم المعلمة
إعداد المعلمة
CatBoost
task_type
GPU*
max_ctr_complexity
1
max_depth
5
ET
max_depth
8
XGBoost
max_depth
3
tree_method
gpu_hist*
Random Forest
max_depth
4
مقياس الأداء
لتقييم فعالية تقنيات اختيار الميزات، قمنا ببناء نماذج تصنيف بعد عملية اختيار الميزات. كانت تقييم هذه النماذج في هذه الدراسة بناءً على مقياس منطقة تحت منحنى الدقة-استرجاع (AUPRC).
في مشكلة تصنيف ذات فئتين، مثل التمييز بين الاحتيال (إيجابي) والحالات العادية (سلبي)، نواجه أربعة نتائج محتملة للتنبؤ: إيجابي حقيقي (حالات إيجابية مصنفة بشكل صحيح)، إيجابي زائف (حالة سلبية تم تصنيفها عن طريق الخطأ على أنها إيجابية)، سلبي حقيقي (حالات سلبية مصنفة بشكل صحيح)، وسلبي زائف (حالة إيجابية تم تصنيفها عن طريق الخطأ على أنها سلبية).
يمثل AUPRC المساحة تحت منحنى الدقة والاسترجاع، والذي يوضح التوازن بين الاسترجاع (معدل الإيجابيات الحقيقية) والدقة لعتبات تصنيف محددة. تعريف الدقة هو
ومعدل الاسترجاع أو معدل الإيجابيات الحقيقية يُعرف بأنه
لحساب AUPRC، نقوم برسم الدقة مقابل الاسترجاع لعدة عتبات تصنيف ثم نحدد المساحة تحت المنحنى. تشير قيمة AUPRC الأعلى إلى أداء نموذج أفضل. يتراوح AUPRC من الحد الأدنى صفر إلى الحد الأقصى واحد.
التحقق المتقاطع
يشير التحقق المتقاطع إلى تقنية تُستخدم للسماح بتدريب واختبار نماذج التعلم الآلي دون اللجوء إلى استخدام نفس البيانات [29]. تتضمن العملية تقسيم مجموعة البيانات إلى عدد محدد مسبقًا من المجموعات الفرعية أو الطيات بطريقة متوازنة نسبيًا. في هذه الدراسة، استخدمنا التحقق المتقاطع بخمس طيات، حيث كانت كل طية تعمل كبيانات اختبار، بينما تم تخصيص الطيات الأربع المتبقية كبيانات تدريب. لتقليل أي تحيز محتمل ناتج عن تقسيم عشوائي أو غير مواتٍ، أجرينا عشرة تجارب مستقلة من التحقق المتقاطع بخمس طيات.
من المهم ملاحظة، من أجل إعادة الإنتاج، أن عملية اختيار الميزات تمت بشكل منفصل عن خطوة التحقق المتقاطع. بعبارة أخرى، تم تنفيذ إجراءات اختيار الميزات على مجموعة البيانات الأصلية.
التجارب
مجموعة البيانات
استخدمت التجارب التي أجريت في هذه الدراسة مجموعة بيانات كشف احتيال بطاقات الائتمان، المتاحة للتنزيل من موقع كاجل [12]. تتكون هذه المجموعة من معاملات مالية مجهولة الهوية، تحديدًا معاملات بطاقات الائتمان التي أجراها حاملو بطاقات أوروبيون على مدى يومين في سبتمبر 2013. كما ذُكر سابقًا، من إجمالي 284,807 معاملة، هناك 492 منها هي
معاملات احتيالية، مما يؤدي إلى مجموعة بيانات غير متوازنة حيث أن فقط من المعاملات تعتبر احتيالية، بينما تعتبر البقية معاملات عادية أو غير احتيالية.
تحتوي مجموعة بيانات كشف احتيال بطاقات الائتمان على 30 ميزة إدخال عددية، من بينها قد خضعت لتحويل عددي باستخدام تحليل المكونات الرئيسية (PCA) لأغراض تحليل البيانات وتقليل الميزات. ومع ذلك، لم يتم تحويل ميزات “الوقت” و”المبلغ”. تشير ميزة “الوقت” إلى الوقت بالثواني منذ المعاملة الأولى، بينما تمثل ميزة “المبلغ” مقدار معاملة بطاقة الائتمان. تم استبعاد ميزة “الوقت” من التحليل لتجنب التأثير على موثوقية النتائج لأنها ميزة فريدة يمكن للنموذج تذكرها. نتيجة لذلك، هناك 29 ميزة إدخال متاحة لمزيد من التجارب. قبل إدخالها إلى المصنفات للتدريب أو التصنيف، تم تطبيع الميزات لتناسب ضمن النطاق. تُستخدم ميزة الفئة للتمييز بين المعاملات الشرعية والاحتيالية. في هذا السياق، تمثل القيمة 1 معاملة احتيالية، بينما تشير القيمة 0 إلى معاملة عادية.
تصميم التجربة
في تجاربنا، بحثنا في تقنيتين مختلفتين لاختيار الميزات، وهما اختيار الميزات القائم على قيمة SHAP وطرق اختيار الميزات القائمة على الأهمية. لتقييم فعالية طريقة اختيار الميزات، قمنا ببناء نماذج تصنيف باستخدام مجموعة الميزات التي اختارها نهج اختيار الميزات. تم بناء نماذج التصنيف باستخدام خمسة مصنفات، XGBoost، شجرة القرار (DT)، CatBoost، الأشجار العشوائية للغاية (ET)، وغابة عشوائية (RF).
أجرينا تجاربنا على منصة حوسبة موزعة تتكون من عقد مزودة بمعالجات Intel Xeon ذات 16 نواة، و256 جيجابايت من ذاكرة الوصول العشوائي لكل معالج، وNvidia V100 GPUs. تم تنفيذ جميع برامج التدريب والاختبار باستخدام لغة البرمجة بايثون. SHAP متاحة للجمهور كمكتبة مفتوحة المصدر للغة البرمجة بايثون [30]. بالإضافة إلى قيم SHAP لأهمية الميزات، توفر هذه المكتبة أيضًا العديد من الأدوات لتصور قيم أهمية ميزات SHAP. تم استخدام مجموعة أدوات علوم البيانات بايثون [31] لتنفيذ التجارب.
أولاً، قمنا بترتيب الميزات باستخدام عشرة طرق لاختيار الميزات (SHAP-XGBoost، XGBoost، SHAP-DT، DT، SHAP-CatBoost، CatBoost، SHAP-ET، ET، SHAP-RF، و بشكل منفصل. بعد ترتيب الميزات، اخترنا أفضل ، و15 ميزة، بما في ذلك سمة الفئة، لبناء مجموعات بيانات التدريب النهائية. بعد ذلك، طبقنا المصنفات على هذه المجموعات التدريبية، مع التأكد من أن المصنف المستخدم في عملية بناء النموذج ظل متسقًا مع ذلك المستخدم في اختيار الميزات. استخدمنا AUPRC لتقييم أداء نماذج التصنيف. لكل طريقة اختيار ميزات ومصنف، لدينا إجمالي 5 (أحجام مجموعة الميزات) (تشغيلات) (طيات) درجات AUPRC.
النتائج والمناقشة
كما ذُكر سابقًا، قدمنا عشرة طرق لاختيار الميزات، وتقنيتين لاختيار الميزات مقترنتين بخمسة مصنفات. نقدم قوائم أهمية الميزات التي تم الحصول عليها من كل طريقة، حيث نركز على أفضل 15 ميزة الأكثر أهمية. يتم تحديد الأهمية إما بواسطة قيم SHAP (لـ SHAP-XGBoost، SHAP-DT،
الجدول 2 الميزات المختارة بواسطة SHAP-XGBoost وXGBoost؛ الميزات مدرجة حسب قيم أهميتها من الأعلى إلى الأسفل
الترتيب
SHAP-XGBoost
XGBoost
1
2
3
4
المبلغ
5
6
7
8
9
10
11
12
13
المبلغ
14
15
الجدول 3 الميزات المختارة بواسطة SHAP-DT وDT؛ الميزات مدرجة حسب قيم أهميتها من الأعلى إلى الأسفل
الترتيب
SHAP-DT
DT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
المبلغ
15
SHAP-CatBoost، SHAP-ET، وSHAP-RF) أو درجات الأهمية المدمجة (لـ XGBoost، DT، CatBoost، ET، وRF). في الجداول 2، 3، 4، 5، 6، نعرض تصنيفات الميزات، حيث يتوافق الترتيب 1 مع أعلى قيمة SHAP أو درجة أهمية. من المهم ملاحظة أن قيم SHAP قد تختلف عند استخدام نماذج مدربة مختلفة. من الجدير بالذكر أنه من بين جميع طرق اختيار الميزات العشر، برزت ميزة كواحدة من أفضل ثلاث ميزات. بالإضافة إلى ذلك، ظهرت ميزة باستمرار وحافظت على ترتيب ضمن أفضل 15 عبر جميع طرق اختيار الميزات.
تظهر نتائج أداء التصنيف من حيث AUPRC في الجداول 7، 8، . تمثل القيم المبلغ عنها متوسطات عبر عشرة جولات من نتائج التحقق المتقاطع بخمس طيات. تم الحصول على النتائج من خلال إنشاء مجموعات بيانات جديدة باستخدام 3،
الجدول 4 الميزات المختارة بواسطة SHAP-CatBoost وCatBoost؛ الميزات مدرجة حسب قيم أهميتها من الأعلى إلى الأسفل
الترتيب
SHAP-CatBoost
CatBoost
1
2
3
4
المبلغ
5
6
7
المبلغ
8
9
10
11
12
13
14
15
الجدول 5 الميزات المختارة بواسطة SHAP-ET وET؛ الميزات مدرجة حسب قيم أهميتها من الأعلى إلى الأسفل
الترتيب
SHAP-ET
ET
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
5، 7، 10، و15 من الميزات الأعلى تصنيفًا جنبًا إلى جنب مع سمة الفئة لتشكيل بيانات التدريب النهائية. أجرينا اختبارات إحصائية -tests [32] على أزواج من النماذج (نفس المصنف ولكن طرق اختيار ميزات مختلفة)، حيث يتكون كل زوج من نموذج واحد تم بناؤه باستخدام من الميزات الأكثر أهمية التي اختارها SHAP أو قائمة أهمية الميزات المدمجة للنموذج. تتراوح قيمة من 3 إلى 15. الفرضية الصفرية هي أنه لا يوجد فرق كبير بين متوسط درجات AUPRC للنموذجين. في الجداول 7، 8، تشير عمود الفائز إلى ما إذا كانت طريقة اختيار الميزات SHAP أو المدمجة لديها قيمة AUPRC متوسطة أعلى بناءً على نتيجة اختبار -test بمستوى دلالة قدره . إذا لم يكن الفرق في المتوسطات كبيرًا، نبلغ عن تعادل.
الجدول 6 الميزات المختارة بواسطة SHAP-RF وRF؛ الميزات مدرجة حسب قيم أهميتها من الأعلى إلى الأسفل
الترتيب
SHAP-RF
RF
1
2
3
4
5
6
7
8
9
10
11
12
١٣
14
المبلغ
15
الجدول 7 مقارنة بين طرق اختيار الميزات SHAP و XGBoost من حيث درجات AUPRC الخاصة بها
حجم
SHAP-XGBoost
إكس جي بوست
-قيمة
الفائز
٣
0.7247
0.7727
0.0000
إكس جي بوست
٥
0.8165
0.7978
0.0121
رباط
٧
0.8302
0.8255
0.5005
رباط
10
0.8446
0.8350
0.0041
SHAP-XGBoost
15
0.8535
0.8557
0.7097
رباط
الجدول 8 مقارنة بين طرق اختيار الميزات SHAP و DT من حيث درجات AUPRC الخاصة بها
حجم
شيب-دي تي
دي تي
-قيمة
فائز
٣
0.7421
0.7323
0.4968
رباط
٥
0.7493
0.7414
0.6293
رباط
٧
0.7594
0.7666
0.7013
رباط
10
0.7380
0.7686
0.2429
رباط
15
0.7664
0.7564
0.5058
رباط
الجدول 9 مقارنة بين طرق اختيار الميزات SHAP و CatBoost من حيث درجات AUPRC الخاصة بها
حجم
شيب-كات بوست
كات بوست
-قيمة
الفائز
٣
0.6106
0.7235
0.0000
كات بوست
٥
0.7266
0.7745
0.0000
كات بوست
٧
0.7897
0.8279
0.0000
كات بوست
10
0.8333
0.8472
0.0000
كات بوست
15
0.8506
0.8491
0.7502
رباط
الجدول 10 مقارنة بين طرق اختيار الميزات SHAP و ET من حيث درجات AUPRC الخاصة بها
حجم
شيب-إيت
إي تي
-قيمة
الفائز
٣
0.7796
0.7843
0.6756
رباط
٥
0.8172
0.8118
0.4243
رباط
٧
0.8143
0.8137
0.9179
رباط
10
0.8175
0.8168
0.9152
رباط
15
0.8086
0.8048
0.7238
رباط
الجدول 11 مقارنة بين طرق اختيار الميزات SHAP و RF من حيث درجات AUPRC الخاصة بها
حجم
شيب-آر إف
RF
-قيمة
الفائز
٣
0.8097
0.8137
0.5673
رباط
٥
0.8396
0.8248
0.0133
رباط
٧
0.8416
0.8382
0.6126
رباط
10
0.8447
0.8479
0.6399
رباط
15
0.8544
0.8512
0.6693
رباط
الجدول 12 تحليل التباين (ANOVA) لحجم، المصنف والتقنية كعوامل للأداء من حيث AUPRC
Df
مجموع المربعات
متوسط المربعات
قيمة F
حجم
٤
1.90
0.48
٢٣٧.٤٤
أقل من
مصنف
٤
2.11
0.53
262.91
أقل من
تقنية
1
0.05
0.05
٢٤.٧٧
أقل من
المتبقيات
٢٤٩٠
٤.٩٩
0.00
يوضح الجدول 7 تعادلًا لنماذج XGBoost المبنية على أحجام مجموعات الميزات 5 و 7 و 15. ومع ذلك، بالنسبة لحجم مجموعة الميزات 3، فإن-القيمة أقل من مستوى الدلالة 0.01، مما يشير إلى وجود فرق كبير في درجات AUPRC. لذلك، يتفوق XGBoost على SHAP-XGBoost لعدد الميزات 3. من ناحية أخرى، بالنسبة لحجم مجموعة الميزات 10، يتفوق SHAP-XGBoost على XGBoost.
تشير الجدول 8 إلى أنه لا يوجد فرق ذو دلالة إحصائية في درجات AUPRC بين SHAP-DT و DT لأي من عدد الميزات المختبرة.، و 15 ). نتيجة لذلك، لا يمكننا إعلان فائز بين طريقتي اختيار الميزات بناءً على درجات AUPRC. الجداول 10 و 11 مشابهة للجدول 8. تشير النتائج إلى أنه، بالنسبة لمجموعة البيانات ومعيار التقييم المعطى، لا يوجد أداء متفوق متسق بين طرق اختيار الميزات باستخدام SHAP وطرق شجرة القرار التقليدية المعتمدة على قيمة الأهمية، أو شجرة إضافية، أو طرق الغابة العشوائية عبر أحجام الميزات المختلفة.
تقدم الجدول 9 مقارنة بين طريقتي اختيار الميزات SHAP-CatBoost و CatBoost من حيث درجات AUPRC لأحجام ميزات مختلفة. باختصار، بالنسبة لأحجام الميزات من 3 إلى 10، يتفوق CatBoost باستمرار على SHAP-CatBoost من حيث AUPRC، وتكون الفروق ذات دلالة إحصائية مع قيم p تبلغ 0.0000. ومع ذلك، بالنسبة للحجم 15، لا توجد فروق ذات دلالة إحصائية بين الطريقتين، مما يؤدي إلى تعادل.
بشكل عام، فإن أداء طريقتي اختيار الميزات قابل للمقارنة عبر سيناريوهات مختلفة. ومع ذلك، هناك حالات محددة، مثل بعض نماذج XGBoost و CatBoost، حيث تظهر الفروق. من الجدير بالذكر أن XGBoost يظهر أداءً متفوقًا على SHAP-XGBoost عندما يكون حجم مجموعة الميزات 3، بينما يتفوق CatBoost على SHAP-CatBoost لأحجام الميزات 3 و 5 و 7 و 10. علاوة على ذلك، يتفوق SHAP-XGBoost على XGBoost عندما يكون حجم مجموعة الميزات 10.
تم إجراء تحليل التباين (ANOVA) [33] على مقاييس أداء AUPRC، وتم الإبلاغ عن النتائج في الجدول 12. تم اعتبار ثلاثة عوامل، الحجم، المصنف، والتقنية، في التحليل. شمل عامل الحجم أحجام مجموعات الميزات 3، 5، 7، 10، و15، بينما شمل عامل المصنف خمسة مصنفات، في حين شمل عامل التقنية طريقتين لاختيار الميزات، المعتمدتين على قيمة SHAP (ممثلة بـ SHAP) وقيمة الأهمية (ممثلة بـ Importance). استخدم الاختبار الإحصائي مستوى دلالة تشير نتائج تحليل التباين (ANOVA) إلى وجود اختلافات كبيرة بين المجموعات في كل من العوامل الرئيسية من حيث مقياس AUPRC، حيث أن جميعأو كانت قيم p في العمود الأخير من الجدول أقل من الحد الأدنى 0.01.
نظرًا لأن نتائج اختبار ANOVA أظهرت أن جميع العوامل كان لها تأثير كبير على درجات AUPRC، قمنا بإجراء اختبارات الفرق المعنوي الصادق لتوكاي (HSD) [34] لترتيب التقنية والمصنف بناءً على تأثيرهما على درجات AUPRC. تم ترتيب الأداء أبجديًا، حيث كانت المجموعة ‘أ’ لديها أعلى درجات AUPRC. تشير العناصر في نفس مجموعة الأداء إلى عدم وجود فرق معنوي إحصائي بينها. تم تقديم نتائج اختبار HSD في الجداول 13 و 14 و 15.
استنادًا إلى اختبارات HSD، من الواضح أن اختيار الميزات بحجم مجموعة فرعية من 15 و10 يعطي أداءً أفضل في AUPRC مقارنةً بأحجام المجموعات الفرعية الأصغر. وهذا يشير إلى أن بناء النماذج بحجم مجموعة فرعية من 15 أو 10 هو أمر مفيد. الحجم المنخفض يؤدي إلى أوقات تدريب نماذج أسرع ونتائج محسّنة. من بين خمسة مصنفات، أظهر RF أعلى AUPRC، تلاه XGBoost وET.
الجدول 13 مجموعات اختبار HSD بعد تحليل التباين (ANOVA) لمقياس AUPRC لعامل الحجم
Group a consists of: 15
Group ab consists of: 10
Group b consists of: 7
Group c consists of: 5
Group d consists of: 3
الجدول 14 مجموعات اختبار HSD بعد تحليل التباين (ANOVA) لمقياس AUPRC لعامل المصنف
Group a consists of: RF
Group b consists of: XGBoost, ET
Group c consists of: CatBoost
Group d consists of: DT
الجدول 15 مجموعات اختبار HSD بعد تحليل التباين (ANOVA) لمتغير AUPRC لعامل التقنية بينما أظهر DT أداءً أقل نسبيًا. تشير الجدول 15 إلى أن طريقة اختيار الميزات المعتمدة على قيمة الأهمية تتفوق بشكل كبير على طريقة اختيار الميزات المعتمدة على قيمة SHAP، عبر جميع أحجام مجموعات الميزات والمتعلمين.
كما ذُكر سابقًا، فإن SHAP هو أداة خارجية، ووقت الحساب لاختيار الميزات باستخدام SHAP يعتمد على عدة عوامل، بما في ذلك تعقيد النموذج، وعدد الميزات، وحجم مجموعة البيانات، وعدد الحالات التي تحتاج إلى حساب قيم SHAP لها. عمومًا، فإن تعقيد حساب قيم SHAP أعلى من طرق أهمية الميزات الأخرى مثل المصنفات المعتمدة على شجرة القرار. لذلك، نستنتج أن استخدام أهمية الميزات المدمجة لاختيار مجموعات الميزات قد يكون أكثر ملاءمة للنماذج التي تحتوي على عدد كبير من الميزات ومجموعة بيانات كبيرة.
الخاتمة
تؤثر تحديات التعامل مع الأبعاد العالية في تعلم الآلة بشكل كبير على تقييم أداء النموذج. تركز هذه الدراسة بشكل خاص على مقارنة تقنيتين لاختيار الميزات: تحديد الميزات الأكثر أهمية من خلال قيم SHAP والاعتماد على قائمة أهمية الميزات الداخلية للنموذج. باستخدام مجموعة بيانات كشف الاحتيال ببطاقات الائتمان، نقوم بإنشاء مجموعات تدريب متعددة. نستخدم خمسة مصنفات بأحجام فرعية مختلفة للميزات، ونطبق كلا طريقتي اختيار الميزات على كل مصنف. تشير نتائجنا إلى أن، بشكل عام، تتفوق طرق اختيار الميزات المعتمدة على قيم الأهمية على تلك المعتمدة على قيم SHAP عبر المصنفات المستخدمة في هذه الدراسة وأحجام المجموعات الفرعية المختلفة.
ومع ذلك، تظهر اختلافات ملحوظة في نماذج XGBoost. يتفوق XGBoost على SHAP-XGBoost لحجم مجموعة الميزات 3، بينما يتفوق SHAP-XGBoost على XGBoost لحجم مجموعة الميزات 10. في حالة CatBoost، يتفوق CatBoost على SHAP-CatBoost لأحجام الميزات التي تقل عن 15. من المهم ملاحظة أن حساب أهمية ميزات SHAP يقدم خطوة إضافية في المنهجية التجريبية. وفقًا لنتائجنا، قد يكون العائد على الاستثمار من تنفيذ SHAP منخفضًا نسبيًا، خاصة عندما تتوفر طرق اختيار الميزات المدمجة، خاصةً للبيانات الكبيرة. بالإضافة إلى ذلك، قد تجعل النفقات الحاسوبية الكبيرة المرتبطة بـ SHAP من غير العملي التعامل مع البيانات الضخمة. بالنسبة للبحوث المستقبلية، خطتنا هي استكشاف هذين الطريقتين لاختيار الميزات عبر مجالات تطبيق متنوعة.
شكر وتقدير
يود المؤلفون أن يشكروا الأعضاء المختلفين في مختبر تعدين البيانات وتعلم الآلة بجامعة فلوريدا أتلانتيك، على مساعدتهم في المراجعات.
مساهمات المؤلفين
ساهمت HJW في المخطوطة. أجرى QXL و JTH التجارب، وساهم JTH في المخطوطة. قدم TMK إشرافًا على التجارب، ونسق البحث، وساهم في المخطوطة.
تمويل
غير قابل للتطبيق.
توفر البيانات والمواد
غير قابل للتطبيق.
الإعلانات
موافقة الأخلاقيات والموافقة على المشاركة
غير قابل للتطبيق.
الموافقة على النشر
غير قابل للتطبيق.
المصالح المتنافسة
يعلن المؤلفون أنهم ليس لديهم مصالح متنافسة.
تم الاستلام: 18 ديسمبر 2023 تم القبول: 14 مارس 2024
تم النشر عبر الإنترنت: 26 مارس 2024
References
Hancock JT, Khoshgoftaar TM, Johnson JM. A comparative approach to threshold optimization for classifying imbalanced data. In: The International Conference on Collaboration and Internet Computing (CIC), Atlanat, GA, USA, 2022. pp. 135-142. IEEE.
Wang H, Liang Q, Hancock JT, Khoshgoftaar TM. Enhancing credit card fraud detection through a novel ensemble feature selection technique. In: 2023 IEEE International Conference on Information Reuse and Integration (IRI), Bellevue, WA, USA, 2023. pp. 121-126.
Lundberg S.M, Lee S.-I. A unified approach to interpreting model predictions. Adv Neural Inf Process Syst. 2017;30.
Waspada I, Bahtiar N, Wirawan PW, Awa BDA. Performance analysis of isolation forest algorithm in fraud detection of credit card transactions. Khazanah Informatika Jurnal. 2022.
Wang H, Hancock JT, Khoshgoftaar TM. Improving medicare fraud detection through big data size reduction techniques. In: 2023 IEEE International Conference on Service-Oriented System Engineering (SOSE), Athens, Greece; 2023. pp. 208-217.
Chen T, Guestrin C. Xgboost: a scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining-KDD ’16. 2016.
Breiman L. Classification and regression trees. 2017.
Prokhorenkova L, Gusev G, Vorobev A, Dorogush AV, Gulin A. Catboost: unbiased boosting with categorical features. Adv Neural Inf Process Syst. 2018;31.
Geurts P, Ernst D, Wehenkel L. Extremely randomized trees. Mach Learn. 2006;63(1):3-42.
Breiman L. Random forests. Mach Learn. 2001;45(1):5-32.
Ke G, Meng Q, Finley T, Wang T, Chen W, Ma W, Ye Q, Liu T-Y. Lightgbm: a highly efficient gradient boosting decision tree. Adv Neural Inf Process Syst. 2017;30:3146-54.
Leevy JL, Khoshgoftaar TM, Hancock JT. Evaluating performance metrics for credit card fraud classification. In: 2022 IEEE 34th International Conference on Tools with Artificial Intelligence (ICTAI), 2022. pp. 1336-1341.
Rtayli N, Enneya N. Selection features and support vector machine for credit card risk identification. Procedia Manuf. 2020;46:941-8.
González S, García S, Ser JD, Rokach L, Herrera F. A practical tutorial on bagging and boosting based ensembles for machine learning: algorithms, software tools, performance study, practical perspectives and opportunities. Inf Fusion. 2020;64:205-37.
Hancock JT, Khoshgoftaar TM, Johnson JM. Evaluating classifier performance with highly imbalanced big data. J Big Data. 2023;10(42).
Rosley N, Tong G-K, Ng K-H, Kalid SN, Khor K-C. Autoencoders with reconstruction error and dimensionality reduction for credit card fraud detection. J Syst Manag Sci. 2022;12(6):70-80.
Kursa MB, Rudnicki WR. Feature selection with the Boruta package. J Stat Softw. 2010;36(11):1-13.
Liu Y, Liu Z, Luo X, Zhao H. Diagnosis of Parkinson’s disease based on SHAP value feature selection. Biocybern Biomed Eng. 2022;42(3):856-69.
Sakar CO, Serbes G, Gunduz A, Tunc H, Nizam H, Sakar B, Tütüncu M, Aydin T, Isenkul M, Apaydin H. A comparative analysis of speech signal processing algorithms for Parkinson’s disease classification and the use of the tunable q-factor wavelet transform. Appl Soft Comput. 2019;74:255-63.
Marcilio WE, Eler DM. From explanations to feature selection: assessing SHAP values as feature selection mechanism. In: 2020 33rd SIBGRAPI Conference on Graphics, Patterns and Images (SIBGRAPI), Los Alamitos, CA, USA, 2020. pp. 340-347.
Hancock JT, Khoshgoftaar TM. Gradient boosted decision tree algorithms for Medicare fraud detection. SN Comput Sci. 2021;2(4):268.
Muaz A, Jayabalan M, Thiruchelvam V. A comparison of data sampling techniques for credit card fraud detection. Int J Adv Comput Sci Appl (IJACSA). 2020;11(6):477-85.
Shapley L. A value for n-person games. Contributions to the Theory of Games, 1953. pp. 307-317.
Kushwah JS, Kumar A, Patel S, Soni R, Gawande A, Gupta S. Comparative study of regressor and classifier with decision tree using modern tools. Mater Today Proc. 2022;56(6):3571-6.
Friedman JH. Greedy function approximation: a gradient boosting machine. Ann Stat. 2001;1189-1232.
Gupta A, Nagarajan V, Ravi R. Approximation algorithms for optimal decision trees and adaptive tsp problems. Math Oper Res. 2017;42(3):876-96.
Breiman L. Bagging predictors. Mach Learn. 1996;24(2):123-40.
Witten IH, Frank E, Hall MA. Data mining: practical machine learning tools and techniques. 2011.
Feature selection strategies: a comparative analysis of SHAP-value and importance-based methods
Huanjing Wang , Qianxin Liang , John T. Hancock²and Taghi M. Khoshgoftaar²
*Correspondence: huanjing.wang@wku.edu Ogden College of Science and Engineering, Western Kentucky University, Bowling Green, USA College of Engineering and Computer Science, Florida Atlantic University, Boca Raton, USA
Abstract
In the context of high-dimensional credit card fraud data, researchers and practitioners commonly utilize feature selection techniques to enhance the performance of fraud detection models. This study presents a comparison in model performance using the most important features selected by SHAP (SHapley Additive exPlanations) values and the model’s built-in feature importance list. Both methods rank features and choose the most significant ones for model assessment. To evaluate the effectiveness of these feature selection techniques, classification models are built using five classifiers: XGBoost, Decision Tree, CatBoost, Extremely Randomized Trees, and Random Forest. The Area under the Precision-Recall Curve (AUPRC) serves as the evaluation metric. All experiments are executed on the Kaggle Credit Card Fraud Detection Dataset. The experimental outcomes and statistical tests indicate that feature selection methods based on importance values outperform those based on SHAP values across classifiers and various feature subset sizes. For models trained on larger datasets, it is recommended to use the model’s built-in feature importance list as the primary feature selection method over SHAP. This suggestion is based on the rationale that computing SHAP feature importance is a distinct activity, while models naturally provide built-in feature importance as part of the training process, requiring no additional effort. Consequently, opting for the model’s built-in feature importance list can offer a more efficient and practical approach for larger datasets and more intricate models.
Detecting credit card fraud is crucial within the finance industry and heavily relies on the information stored in transaction datasets. However, the finance field and machine learning face a significant research challenge due to the quality of data, as it directly influences decisions made during modeling and analysis . To tackle this issue, we delve into the available feature space, extracting a pertinent set of features. This underscores the importance of feature selection as an essential data cleansing step before engaging in any modeling process. Feature selection has found application in various
contexts within data mining and machine learning, with the goal of removing irrelevant or redundant features from the analysis. This not only results in expedited model training but also enhances classifier performance.
This study delves into a comparison between two feature selection methods: Shapley Additive exPlanation (SHAP)-value-based selection [3] and commonly used impor-tance-based selection [4, 5]. SHAP leverages game theory concepts to compute feature importance in two steps: training a classification model using all features in the initial interaction and then computing SHAP values for each feature, subsequently ranking them to identify the most significant features for modeling the target problem. On the other hand, importance-based selection computes feature importance for all features during the model training process. Both methods are embedded since they involve the model-building process. In our feature selection process, we utilize five learners: Extreme Gradient Boosting (XGBoost) [6], Decision Tree (DT) [7], CatBoost [8], Extremely Randomized Trees (ET) [9], and Random Forest (RF) [10]. The selection of these five learners is based on their ability to generate an importance ranking list during the model-building process. LightGBM [11] was not included in our choices due to its poor performance, as indicated by our preliminary results in comparison to other learners. We have designated the SHAP-value-based methods as SHAP-XGBoost, SHAP-DT, SHAP-CatBoost, SHAP-ET, and SHAP-RF, while referring to the importance-based methods simply as XGBoost, DT, CatBoost, ET, and RF. In total, there are 10 feature selection methods, five from each category.
To conduct our study, we focus on the Credit Card Fraud Detection Dataset, a set of anonymized financial transactions available on Kaggle [12]. This dataset is the only publicly available large data for credit card fraud analysis. Hence the scope of the study is limited to one dataset. With 284,807 transactions and 30 independent features, only 492 ( ) records are labeled fraudulent. Using two different feature selection methods, we assess the performance of five sets of classifier models using different feature selection techniques (SHAP-XGBoost vs. XGBoost, SHAP-DT vs. DT, SHAP-CatBoost vs. CatBoost, SHAP-ET vs ET, and SHAP-RF vs RF) with their respective selected features. The top 3,5,7,10, and 15 features are selected based on their respective scores. For classification, we build credit card fraud detection models using the five classifiers, the same models used in feature selection. The classifiers are evaluated using the Area Under the Precision Recall Curve (AUPRC) metric [13], and we additionally perform a statistical test with a significance level of to assess the statistical significance of our results.
To the best of our knowledge, this study is the first comprehensive empirical investigation comparing the performance of SHAP-value-based feature selection and impor-tance-based feature selection in the context of fraud detection and potentially other application domains in machine learning.
The remainder of the paper is organized as follows. We begin with an overview of related work, which shows the novelty of the research work we exhibit here. Following that we present the methodology used in the experiment, including explanations of two feature methods, classifiers, cross-validation, and performance metric. We then describe the datasets, experimental design, and experimental results. Finally, we conclude the article with key highlights of this study, and offers suggestions for future work.
Related work
Feature selection is a widely used technique in various data mining and machine learning applications. Its primary objective is to identify a subset of features that minimizes prediction errors for classifiers. In this study, we conducted a comprehensive literature review of research that employs either SHapley Additive exPlanations (SHAP) values or the model’s built-in feature importance list for feature selection. While we found a limited number of studies that utilized the model’s built-in feature importance list for feature selection in the context of the Credit Card Fraud Detection Dataset, we did not come across any studies that used SHAP for feature selection specifically in credit card fraud detection. Instead, we found a few studies that applied SHAP for feature selection in other application domains. Moreover, we did not encounter any studies that directly compared the performance of models built with features selected by SHAP feature importance versus models built with features selected by built-in feature importance. Therefore, our study presents a unique contribution to the field of credit card fraud detection, as it explores the comparison between SHAP and the model’s built-in feature importance list for feature selection, a perspective that has not been extensively explored in the existing literature.
Rtayli and Enneya [14] applied a supervised feature selection method, Random Forest, to identify the most predictive features. Random Forest (RF) is an ensemble learning algorithm that is trained in parallel through bagging [15]. Recently, RF has been increasingly exploited as a feature selection method because it can handle complex, highdimensional datasets and can detect interactions between features. It also reduces the risk of overfitting, which occurs when a model is too complex and fits the training data too closely. Moreover, RF calculates the feature importance by measuring the decrease in the impurity of the node when the feature is used for the split. The more the impurity decreases, the more important the feature is considered. By ranking the features based on their importance, RF can help select the most relevant features for the classification task. After selecting a feature subset from the Credit Card Fraud Detection Dataset, the authors ran Support Vector Machine to find fraudulent transactions. The model achieved an Accuracy of , a Sensitivity of , and an AUC of 0.91 , outperforming three other models (Isolation Forest, Decision Tree, and Local Outlier Factor). The study does not provide clear information regarding the number of selected features. Additionally, the authors did not conduct a comparison of the performance between the selected features and the usage of all the available features. Furthermore, it is worth noting that the use of AUC as a metric for classification of imbalanced data has been found to be misleading [16].
In their study using the Credit Card Fraud Detection Dataset [12], Rosley et al. [17] first filtered out the data with a z -score greater than or equal to 3 and then normalized the remaining data using min-max scaling. Then they used Boruta to compute the importance score of each feature. Boruta [18] is a supervised feature selection algorithm that is designed as a wrapper around a Random Forest classifier to identify important features in a dataset. They kept the features with an importance score of 0.5 or higher to train the Autoencoder for each iteration. The model detected credit card fraud by defining a threshold in the reconstruction error to flag the transactions as legitimate or fraudulent. However, the number of features selected in the
preprocessing step has not been specified by the authors. The authors evaluated the models using Accuracy, Precision, Recall, and F1 score. When working with datasets that exhibit significant class imbalance, these may not be suitable metrics due to the overwhelming size of the majority class.
Waspada et al. [4] use the RF classifier to calculate the importance score of each feature. Features with a low importance score are discarded. The paper lists the importance score of all features. The authors analyze several factors (dataset split ratio, the selection of top k features, the amount of fraud data on training data, and the setting of hyper-parameter values) that influence the performance of the Isolation Forest (IF) model to detect fraud on credit card transactions. Isolation Forest is a popular unsupervised outlier detection method. Their findings indicate that the best results can be obtained by setting training-testing ratio of , using the top five features ( ), using only of fraud data, and setting hyper-parameters with the number of trees 100,128 sample maximum, and 0.001 contamination. The model shows impressive results obtaining precision of , recall of , F1 score of , Area Under the Receiver Operating Characteristic Curve (AUC) of 0.97371, and Area under the Precision-Recall Curve (AUPRC) of 0.759228. Waspada et al. utilized only a single importance-based feature selection method and did not incorporate SHAP for feature selection, which we have implemented in our study.
In their study, Liu et al. [19] utilized SHAP for feature selection on the UCI Parkinson’s disease medical dataset [20]. They combined SHAP values with four classifiers: Deep Forest (gcForest), Extreme Gradient Boosting (XGBoost), Light Gradient Boosting machine (LightGBM), and Random Forest (RF). Each classifier was used to calculate the SHAP values of individual features. To assess the effectiveness of SHAP feature selection, they compared it with three filter-based feature selection methods: Fscore, analysis of variance (Anova-F), and Mutual Information. The experiments were conducted with a training and testing ratio of 70:30, and the feature selection was applied to the training dataset. The results showed that the gcForest model based on SHAP value feature selection achieved an impressive classification Accuracy of and an F1-score of 0.945 , with 150 features selected. This performance surpassed the outcomes of other feature selection methods considered in their study. While the authors specifically employed SHAP-value-based feature selection on the training dataset, we utilized the SHAP method across the entire dataset and subsequently conducted cross-validation following the feature selection procedure.
Marcilio and Eler [21] employed the SHAP method as a feature selection technique and compared it against three widely used feature selection methods: Mutual Information, Recursive Feature Elimination, and ANOVA. The SHAP process involved utilizing XGBoost as the underlying model. They conducted experiments on five UCI datasets using the XGBoost classifier and three other UCI datasets using the XGBoost regressor. The results of their study revealed that SHAP outperformed the three commonly used methods in terms of the Area Under the Receiver Operating Characteristic Curve (AUC) metric. However, it was observed that SHAP required more computational time compared to the other feature selection methods. It is worth noting that the datasets used in Marcilio and Eler’s experiments are not highly
imbalanced, and not in the credit card fraud domain. In addition, the datasets are significantly smaller in size compared to the Kaggle Credit Card Fraud Detection Dataset, which caught our attention.
In our review of the literature, we discovered that only a single method of feature selection, either based on SHAP values or importance, was employed. Notably, no research has been identified that compares these two methods, particularly within the domain of credit card fraud detection. In order to fill this gap, our study undertook a comparative analysis of these two feature selection methods, employing five learners in each approach.
Methodology
Importance-based feature selection methods
Importance-based feature selection methods leverage decision trees to identify relevant features from a given dataset. These decision tree-based classifiers, such as Extreme Gradient Boosting (XGBoost) [6, 22], Extremely Randomized Trees (ET) [9], Random Forest (RF) [23], CatBoost [8], and Decision Tree [7], possess a builtin capability to determine feature importance during model fitting in supervised machine learning. Consequently, they can rank features based on their significance in classification tasks, making them valuable for feature selection. By discarding less relevant features and retaining the most important ones, more efficient and accurate models can be created.
In this study, five importance-based feature selection methods were employed: XGBoost [22], Decision Tree (DT) [7], CatBoost [8], Extremely Randomized Trees (ET) [9], and Random Forest (RF) [10].
XGBoost and CatBoost stand out as widely used gradient boosting algorithms, each employing distinct approaches to compute feature importance scores. While both algorithms construct ensembles of decision trees, their methodologies for deriving feature importance scores vary. In XGBoost, these scores are calculated using the “gain” method, evaluating the influence of each feature on model performance throughout the boosting process. In contrast, CatBoost’s ensemble of decision trees calculates feature importance based on the frequency of a feature being utilized for splitting and the subsequent improvement in model performance achieved through those splits.
A Decision Tree classifier is a type of machine learning algorithm used for classification tasks. It constructs a tree-like model of decisions and their potential outcomes by recursively splitting the data based on the most informative features at each node. Decision trees generate feature importance scores by evaluating their ability to reduce Gini impurity (or increase purity) within the data as the tree is built.
Extremely Randomized Trees and Random Forest, both rooted in decision tree ensembles, share common principles like Gini impurity and the Mean Decrease in Impurity to gauge feature importance. However, Extremely Randomized Trees introduce heightened randomness in the decision-making process during tree construction. This added stochasticity can result in divergent importance scores, potentially impacting the balance between model bias and variance.
SHAP-value-based feature selection methods
Shapley Additive exPlanation (SHAP), introduced by Lundberg and Lee [3], has gained popularity as a method for interpreting machine learning model predictions. By utilizing Game Theory techniques [24], SHAP provides insights into the contribution of each feature to specific predictions. It falls under a family of additive feature attribution techniques that remain model-agnostic, making them universally applicable to various machine learning and deep learning models. These techniques attribute significance to individual input features, facilitating better understanding of model behavior.
In the context of feature selection, SHAP-based methods work as follows: classification models, such as XGBoost and Decision Tree in this study, are trained on the entire dataset. Subsequently, SHAP values are computed for each instance, and these values are then aggregated across the dataset to derive average absolute values for each feature. The computation of SHAP values becomes computationally complex due to this process. The average SHAP value indicates the typical impact of each feature on model predictions across the entire dataset, while the absolute SHAP value represents the feature’s importance, irrespective of its direction (positive or negative). By sorting features based on their average absolute SHAP values in descending order, features with higher SHAP values are identified as more influential in influencing the model’s predictions.
Classification
In this study, credit card fraud detection models were built with five different classifiers, namely XGBoost [6], Decision Tree (DT) [7], CatBoost [8], Extremely Randomized Trees (ET) [9], and Random Forest (RF) [10]. Among these five learners, XGBoost, CatBoost, ET, and RF are ensemble of Decision Tree-based classifiers [25]. We select these learners on the basis that they are highly effective for dealing with complex, high-dimensional data and are known for their excellent performance in a wide range of classification tasks [25].
XGBoost and CatBoost are all gradient boosting frameworks that are widely used for machine learning tasks, particularly for classification. These two algorithms are known to be highly effective and produce accurate predictions. However, the performance may vary depending on the specific dataset and problem at hand. XGBoost is an advanced refinement the Gradient Boosted Decision Tree (GBDT) ensemble method. GBDTs were initially introduced by Friedman in 2001 [26]. XGBoost enhances GBDTs in multiple ways. Firstly, it employs an improved loss function during training that includes an additional term for regularization, effectively preventing overfitting. Secondly, XGBoost introduces an “approximate algorithm” for calculating splits in the constituent decision trees, which is highly suitable for distributed environments and cases where the entire dataset cannot fit into main memory. Moreover, XGBoost incorporates a specialized algorithm for handling sparse data, where most values are nearly constant with occasional aberrations. The “sparsity aware split finding” feature enables XGBoost to capitalize on sparse data efficiently. CatBoost, on the other hand, is known for its robustness in handling categorical features and missing values, making it suitable for datasets with such characteristics. CatBoost’s core algorithm is Ordered Boosting, which involves sorting the instances used by Decision
Trees. In contrast, XGBoost relies on a weighted quantile sketch and a function that takes into account sparsity. A weighted quantile sketch is an approximate tree learning [27] technique that is utilized for merging and pruning operations, while sparsity deals with values that are either zero or missing.
Breiman introduced the concept of Bagging in the domain of machine learning in a 1996 paper [28]. As our research revolves around binary classification, our focus is on Breiman’s ideas about Bagging applied to binary classification. Extremely Randomized Trees (ET) and Random Forest (RF) are both ensemble learning algorithms that belong to the bagging family of decision tree-based methods. Random Forest, which was introduced by Breiman [10]. Random Forest builds upon the Bagging principle with an added improvement. In a Random Forest, each tree is constructed using a random subset of features and samples. This randomness helps to decorrelate the trees and reduce overfitting. Extremely Randomized Trees extends the concept of Random Forest by selecting values for Decision Tree splits at random, potentially making them more robust and computationally efficient in some scenarios. The choice between the two often depends on the specific characteristics of the data and the desired trade-off between bias and variance. We skip the detailed information about these learners and readers are referred to [25].
Decision Tree (DT) is a widely used supervised machine learning algorithm, prominently applied to classification and regression tasks. It is a non-linear model that recursively partitions input data into subsets based on feature values. Each node in the decision tree represents a decision based on a specific feature and threshold, facilitating predictions based on the input data’s feature values. The resulting decision tree structure is highly interpretable, with each internal node representing a feature-based decision, edges signifying outcomes, and leaf nodes providing predictions.
To ensure the reproducibility of our results, we modified specific hyperparameter settings from their default values as listed in Table 1. Furthermore, we set random number generator seeds for all classifiers to ensure consistent and repeatable outcomes. All other settings were left at their default values. The determination of tree depths was guided by previous experimentation documented in [1], aiming to achieve a suitable trade-off between capturing complex patterns in the data and mitigating overfitting.
Table 1 Hyperparameter settings used in experiments
Classifier
Parameter name
Parameter setting
CatBoost
task_type
GPU*
max_ctr_complexity
1
max_depth
5
ET
max_depth
8
XGBoost
max_depth
3
tree_method
gpu_hist*
Random Forest
max_depth
4
Performance metric
To assess the effectiveness of feature selection techniques, we constructed classification models subsequent to the feature selection process. The evaluation of these models in this study was based on the Area under the Precision-Recall Curve (AUPRC) metric.
In a two-class classification problem, such as distinguishing fraud (positive) and normal (negative) instances, we encounter four potential prediction outcomes: true positive (correctly classified positive instances), false positive (negative instance mistakenly classified as positive), true negative (correctly classified negative instances), and false negative (positive instance mistakenly classified as negative).
AUPRC represents the area under the Precision-Recall curve, which illustrates the trade-off between Recall (True Positive Rate) and Precision for specific classification thresholds. The definition of precision is
and the Recall or True Positive Rate is defined as
To calculate AUPRC, we plot precision against recall for many classification thresholds and then determine the area under the curve. A higher AUPRC value indicates superior model performance. AUPRC ranges from a minimum of zero to a maximum of one.
Cross-validation
Cross-validation refers to a technique used to allow for the training and testing of machine learning models without resorting to using the same data [29]. The process involves dividing the dataset into a predetermined number of subsets or folds in a relatively balanced manner. In this study, we utilized five-fold cross-validation, where each fold served as the test data, while the remaining four folds were designated as the training data. To minimize any potential bias arising from a fortuitous or unfavorable split, we conducted ten independent runs of the five-fold cross-validation.
It is important to note, for reproducibility, that the feature selection process was conducted separately from the cross-validation step. In other words, the feature selection procedures were performed on the original dataset.
Experiments
Dataset
The experiments conducted in this study utilized the Credit Card Fraud Detection Dataset, which is available for download from the Kaggle website [12]. This dataset consists of anonymized financial transactions, specifically credit card transactions conducted by European cardholders over a two-day period in September 2013. As stated previously, out of a total of 284,807 transactions, 492 of them are
fraudulent transactions, resulting in an imbalanced dataset with only of transactions being fraudulent, while the rest are considered normal or non-fraudulent transactions.
The Credit Card Fraud Detection Dataset has 30 numerical input features, out of which have undergone numerical transformation using Principal Component Analysis (PCA) for data analysis and feature reduction purposes. However, the “Time” and “Amount” features were not transformed. The “Time” feature denotes the time in seconds since the first transaction, while the “Amount” feature represents the amount of the credit card transaction. The “Time” feature was excluded from the analysis to avoid influencing the reliability of the results since it is a unique feature that a model can memorize. As a result, there are 29 input features available for further experimentation. Prior to being input to the classifiers for training or classification, the features were normalized to fit within the range. The class feature is utilized to distinguish between legitimate and fraudulent transactions. In this context, a value of 1 represents a fraudulent transaction, while a value of 0 signifies a normal transaction.
Experimental design
In our experiments, we investigated two different feature selection techniques, SHAP-value-based feature selection and importance-based feature selection methods. To assess the efficacy of a feature selection method, we constructed classification models utilizing the subset of features chosen by the feature selection approach. Classification models were built with five classifiers, XGBoost, Decision Tree (DT), CatBoost, Extremely Randomized Trees (ET), and Random Forest (RF).
We conducted our experiments on a distributed computing platform consisting of nodes equipped with 16-core Intel Xeon CPUs, 256 GB RAM per CPU, and Nvidia V100 GPUs. All training and testing programs were implemented using the Python programming language. SHAP is publicly available as an open source library for the Python programming language [30]. In addition to the SHAP values for feature importance, this library also supplies several tools for visualizing SHAP feature importance values. The Python data science stack [31] was employed for experiment implementations.
First, we ranked the features using ten feature selection methods (SHAP-XGBoost, XGBoost, SHAP-DT, DT, SHAP-CatBoost, CatBoost, SHAP-ET, ET, SHAP-RF, and separately. Following feature ranking, we chose the top , and 15 features, including the class attribute, to construct the final training datasets. Subsequently, we applied classifiers to these training datasets, ensuring that the classifier used in the model-building process remained consistent with the one employed in feature selection. We used AUPRC to evaluate the performance of the classification models. For each feature selection method and classifier, we have a total of 5 (feature subset sizes) (runs) (folds) AUPRC scores.
Results and discussion
As mentioned earlier, we have introduced ten feature selection methods, two feature selection techniques combined with five classifiers. We present the feature importance lists obtained from each method, where we focus on the top 15 most important features. The importance is determined either by SHAP values (for SHAP-XGBoost, SHAP-DT,
Table 2 Features selected by SHAP-XGBoost and XGBoost; the features are listed in order of their importance values from top to bottom
Ranking
SHAP-XGBoost
XGBoost
1
2
3
4
Amount
5
6
7
8
9
10
11
12
13
Amount
14
15
Table 3 Features selected by SHAP-DT and DT; the features are listed in order of their importance values from top to bottom
Ranking
SHAP-DT
DT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Amount
15
SHAP-CatBoost, SHAP-ET, and SHAP-RF) or built-in importance scores (for XGBoost, DT, CatBoost, ET, and RF). In Tables 2, 3, 4, 5, 6, we display the feature rankings, where rank 1 corresponds to the highest SHAP value or importance score. It’s important to note that SHAP values may vary when different trained models are utilized. Notably, among all ten feature selection methods, feature stood out as one of the top three features. Additionally, feature consistently appeared and held a ranking within the top 15 across all feature selection methods.
The classification performance results in terms of AUPRC are shown in Tables 7, 8, . The reported values represent averages across ten rounds of five-fold crossvalidation outcomes. The results were obtained by creating new datasets using the 3,
Table 4 Features selected by SHAP-CatBoost and CatBoost; the features are listed in order of their importance values from top to bottom
Ranking
SHAP-CatBoost
CatBoost
1
2
3
4
Amount
5
6
7
Amount
8
9
10
11
12
13
14
15
Table 5 Features selected by SHAP-ET and ET; the features are listed in order of their importance values from top to bottom
Ranking
SHAP-ET
ET
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
5, 7,10 , and 15 highest-ranked features along with the class attribute to form the final training data. We conducted statistical -tests [32] on pairs of models (same classifier but different feature selection methods), where each pair consists of one model built with of the most important features selected by SHAP or the model’s built-in feature importance list. The value of ranges from 3 to 15 . The null hypothesis is that there is no significant difference between the mean AUPRC scores of the two models. In Tables 7, 8, the Winner column indicates whether the SHAP or built-in feature selection method has a higher mean AUPRC value based on the outcome of a -test with a significance level of . If the difference in means is not significant, we report a tie.
Table 6 Features selected by SHAP-RF and RF; the features are listed in order of their importance values from top to bottom
Ranking
SHAP-RF
RF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Amount
15
Table 7 Comparison of SHAP and XGBoost feature selection methods in terms of their AUPRC scores
Size
SHAP-XGBoost
XGBoost
-value
Winner
3
0.7247
0.7727
0.0000
XGBoost
5
0.8165
0.7978
0.0121
Tie
7
0.8302
0.8255
0.5005
Tie
10
0.8446
0.8350
0.0041
SHAP-XGBoost
15
0.8535
0.8557
0.7097
Tie
Table 8 Comparison of SHAP and DT feature selection methods in terms of their AUPRC scores
Size
SHAP-DT
DT
-value
Winner
3
0.7421
0.7323
0.4968
Tie
5
0.7493
0.7414
0.6293
Tie
7
0.7594
0.7666
0.7013
Tie
10
0.7380
0.7686
0.2429
Tie
15
0.7664
0.7564
0.5058
Tie
Table 9 Comparison of SHAP and CatBoost feature selection methods in terms of their AUPRC scores
Size
SHAP-CatBoost
CatBoost
-value
Winner
3
0.6106
0.7235
0.0000
CatBoost
5
0.7266
0.7745
0.0000
CatBoost
7
0.7897
0.8279
0.0000
CatBoost
10
0.8333
0.8472
0.0000
CatBoost
15
0.8506
0.8491
0.7502
Tie
Table 10 Comparison of SHAP and ET feature selection methods in terms of their AUPRC scores
Size
SHAP-ET
ET
-value
Winner
3
0.7796
0.7843
0.6756
Tie
5
0.8172
0.8118
0.4243
Tie
7
0.8143
0.8137
0.9179
Tie
10
0.8175
0.8168
0.9152
Tie
15
0.8086
0.8048
0.7238
Tie
Table 11 Comparison of SHAP and RF feature selection methods in terms of their AUPRC scores
Size
SHAP-RF
RF
-value
Winner
3
0.8097
0.8137
0.5673
Tie
5
0.8396
0.8248
0.0133
Tie
7
0.8416
0.8382
0.6126
Tie
10
0.8447
0.8479
0.6399
Tie
15
0.8544
0.8512
0.6693
Tie
Table 12 ANOVA for Size, Classifier and Technique as factors of performance in terms of AUPRC
Df
Sum Sq
Mean Sq
F value
Size
4
1.90
0.48
237.44
less than
Classifier
4
2.11
0.53
262.91
less than
Technique
1
0.05
0.05
24.77
less than
Residuals
2490
4.99
0.00
Table 7 shows a tie for XGBoost models built on feature subset sizes of 5, 7, and 15. However, for feature subset size 3 , the -value is less than the significance level of 0.01 , indicating a significant difference in the AUPRC scores. Therefore, XGBoost outperforms SHAP-XGBoost for feature count 3. On the other hand, for feature subset size 10, SHAP-XGBoost outperforms XGBoost.
Table 8 indicates that there is no significant difference in the AUPRC scores between SHAP-DT and DT for any of the feature counts tested ( , and 15 ). As a result, we cannot declare a winner between the two feature selection methods based on the AUPRC scores. Tables 10 and 11 are similar to Table 8. The results suggest that, for the given dataset and evaluation metric, there is no consistent superior performance between the SHAP feature selection methods and the traditional impor-tance-value based decision tree, extra tree, or random forest methods across different feature sizes.
Table 9 presents a comparison between SHAP-CatBoost and CatBoost feature selection methods in terms of their AUPRC scores for different feature sizes. In summary, for feature sizes 3-10, CatBoost consistently outperforms SHAP-CatBoost in terms of AUPRC, and the differences are statistically significant with p-values of 0.0000. However, for size 15, there is no statistically significant difference between the two methods, resulting in a tie.
In general, the performance of the two feature selection methods is comparable across various scenarios. However, there are specific instances, such as with certain XGBoost and CatBoost models, where distinctions arise. Notably, XGBoost demonstrates superior performance over SHAP-XGBoost when the feature subset size is 3 , while CatBoost outperforms SHAP-CatBoost for feature sizes 3, 5, 7, and 10. Moreover, SHAP-XGBoost surpasses XGBoost when the feature subset size is 10 .
An analysis of variance (ANOVA) [33] was performed on AUPRC performance metrics, and the results are reported in Table 12. Three factors, Size, Classifier, and Technique, were considered in the analysis. The Size Factor included feature subset sizes of 3, 5, 7,10 , and 15 , the Classifier Factor included five classifiers, while the Technique factor included two feature selection methods, SHAP-value based (Represented with SHAP) and Importance-value based (represented with Importance). The statistical test used a significance level of . The ANOVA results indicate that there were significant differences among the groups in each of the main factors in terms of the AUPRC metric, as all or p -values in the last column of the table were less than the cutoff of 0.01 .
Since the ANOVA test results revealed that all factors had a significant impact on AUPRC scores, we conducted Tukey’s Honestly Significant Difference (HSD) tests [34] to rank the Technique and Classifier based on their impact on AUPRC scores. The performance was ranked alphabetically, with group ‘a’ having the highest AUPRC scores. Items in the same performance group indicate no statistically significant difference between them. The HSD test results are presented in Tables 13, 14, 15.
Based on the HSD tests, it is evident that feature selection with a subset size of 15 and 10 yields superior performance in AUPRC compared to smaller subset sizes. This suggests that constructing models with a feature subset size of 15 or 10 is advantageous. The reduced size leads to faster model training times and improved outcomes. Among the five classifiers, RF demonstrated the highest AUPRC, followed by XGBoost and ET,
Table 13 HSD test groupings after ANOVA of AUPRC for the Size factor
Group a consists of: 15
Group ab consists of: 10
Group b consists of: 7
Group c consists of: 5
Group d consists of: 3
Table 14 HSD test groupings after ANOVA of AUPRC for the Classifier factor
Group a consists of: RF
Group b consists of: XGBoost, ET
Group c consists of: CatBoost
Group d consists of: DT
Table 15 HSD test groupings after ANOVA of AUPRC for the Technique factor
while DT showed relatively poorer performance. Table 15 indicates that the impor-tance-value-based feature selection method significantly outperforms the SHAP-valuebased feature selection method, across all feature subsets sizes, and learners.
As mentioned earlier, SHAP is an external tool, and the computational time for SHAP feature selection depends on several factors, including the model’s complexity, the number of features, the dataset size, and the number of instances for which SHAP values need to be computed. The complexity of computing SHAP values is generally higher than other feature importance methods like decision-tree-based classifiers. Therefore, we conclude that using the built-in feature importance to select feature subsets may be more suitable for models with a large number of features and a large dataset.
Conclusion
The challenge of dealing with high dimensionality in machine learning significantly affects the evaluation of model performance. This study specifically concentrates on the comparison of two feature selection techniques: identifying the most crucial features through SHAP values and relying on the model’s intrinsic feature importance list. Using the Credit Card Fraud Detection Dataset, we generate multiple training datasets. We employ five classifiers with distinct feature subset sizes, applying both feature selection methods to each classifier. Our results indicate that, on the whole, feature selection methods based on importance values outperform those based on SHAP values across the classifiers used in this study and various feature subset sizes.
However, notable variations arise in XGBoost models. XGBoost surpasses SHAPXGBoost for a feature subset size of 3, while SHAP-XGBoost outperforms XGBoost for a feature subset size of 10 . In the case of CatBoost, CatBoost outperforms SHAP-CatBoost for feature sizes less than 15. It is important to note that calculating SHAP feature importance introduces an additional step in the experimental methodology. According to our findings, the return on investment for implementing SHAP may be relatively low, particularly when built-in feature selection methods are available, especially for large datasets. Additionally, the considerable computational expenses associated with SHAP may render it impractical for handling Big Data. For future research, our plan is to explore these two feature selection methods across diverse application domains.
Acknowledgements
The authors would like to thank the various members of the Data Mining and Machine Learning Laboratory, Florida Atlantic University, for their assistance with the reviews.
Author contributions
HJW contributed to the manuscript. QXL and JTH conducted experiments, and JTH contributed to the manuscript. TMK provided oversight of experiments, coordinated research, and contributed to the manuscript.
Funding
Not applicable.
Availability of data and materials
Not applicable.
Declarations
Ethics approval and consent to participate
Not applicable.
Consent for publication
Not applicable.
Competing interests
The authors declare that they have no competing interests.
Received: 18 December 2023 Accepted: 14 March 2024
Published online: 26 March 2024
References
Hancock JT, Khoshgoftaar TM, Johnson JM. A comparative approach to threshold optimization for classifying imbalanced data. In: The International Conference on Collaboration and Internet Computing (CIC), Atlanat, GA, USA, 2022. pp. 135-142. IEEE.
Wang H, Liang Q, Hancock JT, Khoshgoftaar TM. Enhancing credit card fraud detection through a novel ensemble feature selection technique. In: 2023 IEEE International Conference on Information Reuse and Integration (IRI), Bellevue, WA, USA, 2023. pp. 121-126.
Lundberg S.M, Lee S.-I. A unified approach to interpreting model predictions. Adv Neural Inf Process Syst. 2017;30.
Waspada I, Bahtiar N, Wirawan PW, Awa BDA. Performance analysis of isolation forest algorithm in fraud detection of credit card transactions. Khazanah Informatika Jurnal. 2022.
Wang H, Hancock JT, Khoshgoftaar TM. Improving medicare fraud detection through big data size reduction techniques. In: 2023 IEEE International Conference on Service-Oriented System Engineering (SOSE), Athens, Greece; 2023. pp. 208-217.
Chen T, Guestrin C. Xgboost: a scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining-KDD ’16. 2016.
Breiman L. Classification and regression trees. 2017.
Prokhorenkova L, Gusev G, Vorobev A, Dorogush AV, Gulin A. Catboost: unbiased boosting with categorical features. Adv Neural Inf Process Syst. 2018;31.
Geurts P, Ernst D, Wehenkel L. Extremely randomized trees. Mach Learn. 2006;63(1):3-42.
Breiman L. Random forests. Mach Learn. 2001;45(1):5-32.
Ke G, Meng Q, Finley T, Wang T, Chen W, Ma W, Ye Q, Liu T-Y. Lightgbm: a highly efficient gradient boosting decision tree. Adv Neural Inf Process Syst. 2017;30:3146-54.
Leevy JL, Khoshgoftaar TM, Hancock JT. Evaluating performance metrics for credit card fraud classification. In: 2022 IEEE 34th International Conference on Tools with Artificial Intelligence (ICTAI), 2022. pp. 1336-1341.
Rtayli N, Enneya N. Selection features and support vector machine for credit card risk identification. Procedia Manuf. 2020;46:941-8.
González S, García S, Ser JD, Rokach L, Herrera F. A practical tutorial on bagging and boosting based ensembles for machine learning: algorithms, software tools, performance study, practical perspectives and opportunities. Inf Fusion. 2020;64:205-37.
Hancock JT, Khoshgoftaar TM, Johnson JM. Evaluating classifier performance with highly imbalanced big data. J Big Data. 2023;10(42).
Rosley N, Tong G-K, Ng K-H, Kalid SN, Khor K-C. Autoencoders with reconstruction error and dimensionality reduction for credit card fraud detection. J Syst Manag Sci. 2022;12(6):70-80.
Kursa MB, Rudnicki WR. Feature selection with the Boruta package. J Stat Softw. 2010;36(11):1-13.
Liu Y, Liu Z, Luo X, Zhao H. Diagnosis of Parkinson’s disease based on SHAP value feature selection. Biocybern Biomed Eng. 2022;42(3):856-69.
Sakar CO, Serbes G, Gunduz A, Tunc H, Nizam H, Sakar B, Tütüncu M, Aydin T, Isenkul M, Apaydin H. A comparative analysis of speech signal processing algorithms for Parkinson’s disease classification and the use of the tunable q-factor wavelet transform. Appl Soft Comput. 2019;74:255-63.
Marcilio WE, Eler DM. From explanations to feature selection: assessing SHAP values as feature selection mechanism. In: 2020 33rd SIBGRAPI Conference on Graphics, Patterns and Images (SIBGRAPI), Los Alamitos, CA, USA, 2020. pp. 340-347.
Hancock JT, Khoshgoftaar TM. Gradient boosted decision tree algorithms for Medicare fraud detection. SN Comput Sci. 2021;2(4):268.
Muaz A, Jayabalan M, Thiruchelvam V. A comparison of data sampling techniques for credit card fraud detection. Int J Adv Comput Sci Appl (IJACSA). 2020;11(6):477-85.
Shapley L. A value for n-person games. Contributions to the Theory of Games, 1953. pp. 307-317.
Kushwah JS, Kumar A, Patel S, Soni R, Gawande A, Gupta S. Comparative study of regressor and classifier with decision tree using modern tools. Mater Today Proc. 2022;56(6):3571-6.
Friedman JH. Greedy function approximation: a gradient boosting machine. Ann Stat. 2001;1189-1232.
Gupta A, Nagarajan V, Ravi R. Approximation algorithms for optimal decision trees and adaptive tsp problems. Math Oper Res. 2017;42(3):876-96.
Breiman L. Bagging predictors. Mach Learn. 1996;24(2):123-40.
Witten IH, Frank E, Hall MA. Data mining: practical machine learning tools and techniques. 2011.