← Back to Articles
Machine Learning Methods• 8 min read

Comparative Study of Classification Threshold Optimization

Download as PDF

Abstract

With Bangladesh speeding up on its path to a vision of Smart Bangladesh 2041, the nation is not only becoming a consumer of Artificial Intelligence (AI), but also a trial ground of its dangerous implementation. Since the real-time fraud prevention systems offered by mobile financial service providers such as bKash are artificial intelligence-based, and the automated predictors of maternal health risks in rural Upazila Health Complexes are also AI-based, Bangladesh is taking the lead in its digital transformation.

Nevertheless, there is one concealed figure that usually defines the success or failure of such systems the Classification Threshold.

Although defaulting to a 0.5 threshold is common with normal machine learning models, this figure is by no means a universal answer. Theoretically, when a model is 51 percent confident that a transaction is fraud, then it will consider and classify it as fraud. In the special socio-economic context of Bangladesh, though, is a 51 percent certainty decision adequate? Or is it too much? Since the nation is addressing such a complicated problem as financial inclusion and health among the population, this is not just a technical question but a business, ethical and life-changing one.

The most important solution to this dilemma is threshold optimization which enables AI systems to issue context-sensitive decisions. In this posting, we explore the relevance of threshold optimization, interpolate on why the conventional 0.5 threshold does not work in Bangladesh and examine workable measures that resonate with the two financial and healthcare sectors in the country. We consider such advanced methods as ROC curves, Precision-Recall curves, and dynamic threshold tuning in the process that may be used to improve model decision-making in risk-sensitive sectors in Bangladesh.

Fraud detection systems become very important in the financial industry where millions of transactions are carried out daily. In the case of mobile financial services (MFS) such as bKash, Nagad, and Rocket, mobile financial services are critical in the lives of millions of people, especially in rural communities where they have limited access to traditional financial services. These sites are not free of the dangers of false positives, where a valid transaction is mistaken as being fraudulent. False positive rate may be disastrous when it is high, preventing the payment of such vital needs as the salary of garment workers or tuition fees of students, which will destabilize lives and cause the mistrust of the system in the long term. Thus, it is essential to optimize the threshold.

In this regard, such institutions as BRAC Bank are shifting towards precision-optimal thresholds (e.g., 0.7 or 0.8). These thresholds are more focused on customer-friendly minimization rather than the identification of all the possible fraudulent transactions. With a higher threshold, more false negatives (missed cases of fraud) are tolerated by these institutions in the name of making sure that 99% of users who are legitimate will go through without any friction whatsoever. In the financial industry, the concept is that the user experience should be maximized, which is the smooth payment experience, and, at the same time, there should be a reasonable amount of fraud detection. As an illustration, when the threshold is set at 0.8, it implies that the system will not declare a transaction fraudulent unless it is 80 per cent certain. This minimizes False Positives (true transactions that are considered as fraud), but also causes a minimal increase in False Negatives (fraudulent transactions which do not get detected). Although this method may overlook certain fraudulent payments, the main aim is not to block any payments that may be genuine and end up losing customers.

In Bangladesh where financial system is still developing, detection of fraud is a wrong move that might cause customers to be lost and trust is destroyed. Optimized thresholds are used to make sure that the financial institution is at the right balance between customer satisfaction and security particularly with high-volume transaction settings such as with MFS.

There is another dilemma of the Bangladesh healthcare sector. The price of a wrong decision may be even greater. A false negative in this case is failure to detect high risk pregnancy which is fatal. The misdiagnosis situation may turn out to be tragic in rural Bangladesh where access to maternal healthcare services may not be easily available. As a way to reduce these risks, healthcare in the given healthcare setting tends to prioritize the maximization of recall - the capacity to identify as many positive outcomes (pregnancies at risk) as possible. This is by setting the threshold at a lower level (around 0.2 or 0.3). The system has low threshold whereby more patients will be flagged to call back to, but nobody at risk will be left out.

Although this approach raises false positives (i.e. detecting a healthy pregnancy as high-risk) the risk of a high-risk pregnancy that needs urgent treatment is reduced dramatically. Here, false positives are acceptable since the expense of a missed diagnosis of a critical diagnosis would be greater than the burden of a follow-up visit or test.

Medical facilities in rural Bangladesh are usually overwhelmed, and there is a lack of physicians. A Recall-Optimized Threshold can be used in such a way that healthcare providers are kept on the safer side and will make sure that the vulnerable patients are provided with the necessary care, even at the cost of additional follow-up visits. The strategy minimizes chances of medical errors, which can be fatal in cases that are at high risk.

In order to conclude on the best threshold of any given model, we should take into consideration the Precision and Recall of the model. Two of the most frequently used tools to analyze the performance of a model are Receiver Operating Characteristic (ROC) Curves and Precision-Recall (PR) Curves, which are primarily useful when working with imbalanced data (such as in fields such as fraud detection and healthcare). ROC curve is necessary when we are to know the overall ability of a model. It creates a graph of: The True Positive rate (TPR) vs the False Positive rate (FPR) at various false positive rate thresholds. The large area of the ROC curve (AUC) is an indicator of better overall performance. Nonetheless, when the data is not balanced, the ROC curve might not necessarily give the best insights.

In datasets which are not balanced (such as fraud detection (where frauds are uncommon)) or which are at high-risk (such as most pregnancies are at high-risk) the PR Curve is more useful. The PR curve shows the relationship between Precision and Recall, which provides a more precise understanding of what happens to the model in the case when the positive instances (facilitated by fraud cases or high-risk pregnancies) are infrequent. Such a situation is more relevant to the area below the PR curve (AUC-PR).

When we moved the threshold of any of our Dhaka Stock Exchange (DSE) price predictors to 0.62, we cut an 18 percent of the flags on bad investments, but at a cost of only 4 percent of successful trade captures. This change indicates the strength of threshold optimization in the enhancement of model accuracy and decision-making.

In order to use a threshold optimization, one should familiarize him/herself with the various threshold strategies and their intended purposes. The initial approach is F1-Score Maximization that is a compromise between Precision and Recall. It works best on such tasks as sentiment analysis or multi-class classification, when Precision and Recall are important. This threshold should be variable and in most cases it should be close to 0.5, based on data and business goals.

The second is Cost-Sensitive Learning that is used to reduce the total loss of money. It is mostly applied to loan default prediction or insurance fraud detection, where minimization of financial loss is required. A cost matrix is used to compute the threshold, because it considers the cost of a false positive and a false negative.

The third one is Top-K Selection that takes only the most certain cases. The strategy is most effectively used in high-value targeted marketing or when detecting fraud, only the most confident predictions will be implemented. The threshold suggested is dynamic and specific to certain business goals.

The optimization of thresholds is not something the developers and data scientists of Bangladesh do by adjusting a model setting. It entails taking decision making that is more advanced to come up with real time and business conscious decisions. Instead of just using model.predict which uses the default 0.5 threshold, the more advanced method of doing so is model.predict_proba. Such a method gives the scores of probability of each prediction, which will enable us to set a personal threshold.

The positive class (e.g., fraud or default) in most datasets of Bangladesh, whether flood inundation mapping or credit scoring, is less than 5% of the data. Models have to be well-tuned to overcome this imbalance. The model has to be calibrated so that, a probability score of 0.7 really represents a probability of 70 percent occurrence of the event. The high score might be deceptive unless one has calibrated it, which results in the inability to make a good decision. Thresholds are also not supposed to be fixed. As an example, a bank can reduce the fraud detection threshold when traffic is high (such as Eid-ul-Fitr) to fit the anomalous spending patterns.

The vision of Smart Bangladesh dictates the need to have AI systems that not only can make predictions but also make good decisions. With a better classification threshold, we are no longer dealing with generic AI systems but rather we have context-sensitive AI systems that comprehend the distinction between a missed email and a missed medical diagnosis. The appropriate level of threshold optimization is able to avert a catastrophe in such a high-stakes setting as the financial and healthcare industries, allocate resources more efficiently, and increase user satisfaction. Bangladesh has a chance to be at the forefront of implementing more efficient, ethical and strong AI solutions to its fast-growing digital economy by knowing what trade-offs to choose based on its priorities in business, precision, and recall.

CITE THIS ARTICLE

Podder, S. (n.d.). Comparative Study of Classification Threshold Optimization. https://www.researchbysimanto.com/article/c1b37982-bc6c-4fd8-81cd-a7f2be7a59e2

Continue reading

View All Articles

Predicting Student Academic Performance Using Machine Learning

A final CGPA, in the busy academic quarters of Dhaka and elsewhere is indeed the eyeshield of a student in the end of a semester- a kind of revelation of a year of academic results in a nutshell. This moment of truth, though, is not that far away, as something that actually indicates the overall academic path of a student. More and more studies are suggesting that, it is hardly unexpected when academic performance is either successful or not. It is the result of several months of computer and ph

Date not specified

CategoryEducational Data Mining

Feature Engineering Strategies in Educational Data Mining

Machine Learning (ML) algorithms have emerged as the engine of educational predictions in the changing world of Educational Data Mining (EDM) with feature engineering becoming the high-octane fuel that fuels it. In the hugely expanding academic environment of Bangladesh where computer-based classrooms and the traditional learning system collide, it is no longer a conjecture to know whether a student will pass or fail. It has become a specific art of data transformations.

Date not specified

CategoryEducational Data Mining

Early Dropout Prediction Using Supervised Learning

In the changing environment in higher education in Bangladesh, leaving without graduation is seldom an unanticipated move by a student. It can be a slow moving process, and it is characterized by the presence of digital footprints, and minor behavioral changes that nobody notices at all until it is too late. Although the national primary and secondary dropouts have been improving steadily, there is concern in the tertiary level. According to some studies, the level of drop out at the university

Date not specified

CategoryEducational Data Mining