Artificial Intelligence (AI) has been a real game-changer in the past decade, especially in the field of finance. The conventional ‘data-driven’ approach which relied upon human judgment for formulating business decisions has now been replaced by an AI-driven approach that employs state of the art Machine Learning (ML) algorithms making major business decisions. AI has brought about a great technological leap, where we now have large cloud-based processing options that can examine billions of data points in a matter of seconds to give us insights about certain trends present in the data, and also predict future patterns. Certain fields where the power of AI is being harnessed in relation to finance, along with their particular optimization problems, are as follows –
Credit scoring is the analysis done by financial institutions to find out the ‘creditworthiness’ of a person. The creditworthiness of a person refers to their ability to borrow money predicting the likelihood that they will pay back the loan. Higher the credit score of a person, the more credit-worthy they are.
Earlier, these decisions were made by bank officials based on the payment history, the current debt, and the type and length of credit asked for by the customer. With the advancement in technology, ML algorithms are being utilized to create rule-based credit scoring systems that allow the financial institutions to figure out which potential borrowers (who are the end-users of the system) are actually creditworthy or not, and also the maximum credit limit allowed to the borrower.
This is treated as a classification problem with two output variables – yes (allow the customer to borrow money) and no (customer is not credit-worthy). Many ML algorithms like Decision Trees, Random Forests, Support Vector Machines (SVM), Gradient Boosting, Deep Neural Networks (DNN) can be employed for creating this classification system.
The data features taken by the system as input consists of various attributes of the customer like their age, gender, annual/monthly income, general expenditure, their assets, past transactional data, etc. These independent variables can be referred to as X (X1, X2, …., Xn). The final output (O) is a credit score that is converted into a “yes” if it is above a certain threshold, otherwise into a “no”.
For instance, we can create a simple decision tree that takes in the above-mentioned data features as input, and each leaf of the tree is a possible outcome (grant credit – yes or no). Each node in the tree (except the leaf nodes) represent a particular condition being checked at every stage. Entropy or Gini index may be used to find out which attribute to split the data on.
Entropy = and Gini Index =
where, pi = proportion of data samples belonging to class i.
One attribute is selected at each step for splitting the data and creates the condition at that step. Simply tracing down all the paths from the root to the desired outcome (Oi = ‘yes’ for credit decision) will give us a combination of rules that indicate the decision-making process.
For instance, we can create sample conditions
C1 = (X1< Income threshold) AND (X2< Expenditure threshold)
C2 = (X1>= Income threshold) AND (X3>= Assets threshold)
Cm = (X1>= Income threshold) AND (X3< Assets threshold) AND (X4 = Female)
Finally, Oi(yes) = C1OR C2OR … OR Cm
Certain issues like ‘explainability’ and ‘fairness’ must be addressed while creating such systems. As we move towards more and more complex algorithms (such as DNNs which are essentially considered to be a “black-box”), even though we may get more accurate and better results, the explainability of such models decreases, and these are thus not favoured for industry use. We also need to ensure that the developed system is fair and free from human biases and cognitive errors. These systems need to be created in such a way that they are fair (giving an equal advantage to all) and unbiased (not favouring any particular group of people because of protected attributes like age, race, nationality, etc.).
2. Fraud Prevention
Financial institutes are constantly battling against various types of fraudulent activities like money laundering, terrorism financing, identity theft, etc. One of the most frequently occurring fraudulent activities is credit card fraud – causing a worldwide loss of $25 billion (in 2018). These institutes, therefore, spend enormous amounts of resources for the development of fraud detection systems and also act as the end-users of these systems.
Traditional approaches for identifying such activities included manual rule-based solutions with only limited data being referred to at a given time. State of the art systems have been created that enable high volumes of transactional and customer data to be analyzed. This data may include a person’s general purchasing habits, past purchase behaviour, location, etc. These data features can be represented as X (X1, X2, …., Xn). Patterns are formalized and any abnormal activity is flagged by the system. Furthermore, ML has enabled these systems to discover new unknown patterns, tackling the innovative tactics that may be employed by fraudsters.
Many supervised and unsupervised ML algorithms have been employed to create fraud detection systems. Supervised algorithms study labeled past data and identify patterns from that data. Logistic Regression is used to build simple classifiers that study the strength of cause and effect relationship between variables, and determine whether a particular transaction is “good” or not. Decision Trees and Random Forests are used to create rule-based classifiers that study the customer’s behaviour to identify abnormalities. Even complex algorithms like DNNs can be used, but explainability and fairness must be considered here also.
For instance, a simple logistic regression algorithm may take all the above-mentioned data features and represent them as –
O = b0 + b1X1 +b2X2 + … + bnXn
where b0… bnare weights associated with each feature including a bias.
The probability that fraud occurs can be represented by p, where
The value of p over a certain threshold can be mapped to outcome O as fraud is detected.
Unsupervised ML algorithms take unlabelled data and are used to uncover new anomalies or patterns of interest. K-Means, One-Class SVM, Local Outlier Factor, are all unsupervised algorithms that assign data points into regions of similar density (clusters), and any points that lie outside these regions are flagged as anomalies.
AI has supported the development of Intelligent Trading Systems that monitor and analyze past market data along with real-time news to make smart trading decisions. These systems make it easier to buy and sell at the best prices, forecast future market trends accurately, and also efficiently mitigate risks to ensure a higher return on investments. These activities end up enhancing the value of a person’s (or organization’s) portfolio.
Individual traders or even organizations can be the end-users of such systems. Large organizations even perform high-frequency trading that involves complex algorithms running on large powerful computers, executing a large number of transactions within seconds. Predicting the trend is treated as a regression problem where we wish to predict the price of a particular stock at a point in the future. Basic data features used for input to the ML algorithm include opening and closing prices, highest and lowest prices, the volume traded over a certain period. These features may be extracted and combined to form other technical indicators such as Bollinger Bands, Relative Strength Index, Moving Average Convergence/Divergence, etc. The combination of all these data features can be represented as X (X1, X2, …., Xn).
Generally, supervised learning algorithms like Linear or Logistic Regression, SVM, K-Nearest Neighbours, Decision Trees are used to create stock price predictors. DNNs are also used extensively and have given amazing performance but significantly enhance the complexity of the system as well.
For instance, if we use SVM Regressor to predict stock price on the basis of the input features mentioned above, the output hyperplane O can be represented as –
O = b + W1X1 +W2X2 + … + WnXn or O = WX + b
where W1 …Wnare weights associated with each feature including a bias b.
Next, we assume two decision boundaries at a distance ε from the desired hyperplane, and try to find the best hyperplane for the data constrained as –
-ε < O – (WX + b) < ε
4. Personalized Banking
Banks have nearly perfected the art of micro-targeting their customers with a range of products and services that precisely meet their requirements. Examples of these could be credit/debit cards, different types of bank accounts (savings, current, Demat), and even various types of occasion-specific loans.
AI has completely changed how financial institutions interact with their customers (who are the end-users of the AI systems developed by the financial institute). Nearly all major financial institutes now provide a mobile app to its customers which consists of chatbots or voice-enabled smart assistants for simpler client interaction (and to reduce the number of customer care representatives). DNNs, along with their advanced variations – LSTMs, Transformers, etc., are the most commonly used ML techniques used for creating chatbots. These are supervised algorithms that take dialogue data (a combination of contexts and their respective replies) as input, and then generate new replies as they interact with a user. Current user interaction data is also stored and can be used for retraining the model at a later date.
Furthermore, they also have recommender systems that recommend the kind of services and products (e.g. a credit card or a particular type of bank account) that the system feels is best suited for a customer’s need. These systems can be of two types –
Cosine Similarity (A, B) =
K Nearest Neighbours is a commonly used algorithm for recommending products to a new user who joins the system.
This can be calculated as –
tf(t,d) = term frequency =
df(t) = number of documents that contain term t
idf (t) = log(N/df (t)) where N = total number of documents
tfidf (t, d, N) = tf (t, d) * idf (t)
Post system-development activities
After the AI-based solution is created, it is important to check the performance of the system on new untested data. There are various performance metrics such as precision, recall, f-measure, AUC, etc. that tell us how good the model is. Different business objectives discussed above will select different metrics to analyze their model performance.
One important skill for all data scientists to have is the ability to communicate the results of their created model to the upper management, the regulators, and the various stakeholders of the system. The key to doing this is to keep things as simple as possible and describing the problem statement, along with the approach used in layman terms. Explainability of ML algorithms is a big concern (for instance, no one is likely to understand the mechanism behind DNNs). Using various visual graphical tools such as performance graphs, box plots, etc. goes a long way in helping the decision-makers understand the effectiveness of the system, and adopt the system for actual practice.
However, it is commonly observed that the performance of AI systems deteriorates with time. This concept is called ‘drift’ and it occurs because data is the key driver for any AI-based solution. With time, the data on which the system has been trained does not reflect the actual market scenario, and hence the model needs to be refreshed with the new data that is coming in every day to keep getting accurate predictions.
For knowing when refreshing is required, monitoring the model performance is necessary. The most commonly employed strategy used in industry is to set a certain minimum threshold value for the desired metric, and when the model performance drops below that threshold, it is time to refresh the model. Another strategy is to define a timeframe (a week or a month) after which refreshment is done. The most common approaches to refreshing a model are –
A new approach for model refreshment, called ‘Continuous Learning’ is also gaining traction these days. This is an automated process that saves new training data as the model processes it. When there is enough new data, its accuracy is tested against the current model. As the model performance is seen to deteriorate, it automatically incorporates this new data for re-training the model.
We have seen tremendous advancement in the AI field with more and more complex algorithms being invented every day that can tackle new, unprecedented challenges. However, this is just the beginning and AI is only expected to only become more prevalent in the future.
Shao, C. (2018, July 17). A Data Scientist’s Guide to Communicating Results. Retrieved August 05, 2020, from https://medium.com/comet-ml/a-data-scientists-guide-to-communicating-results-c79a5ef3e9f1