Full text
Universidade do Minho Escola de Engenharia Departamento de Informática Guilherme Fraga Palumbo Monitoring and Optimization of an Autonomous Learning System September 2022
Universidade do Minho Escola de Engenharia Departamento de Informática Guilherme Fraga Palumbo Monitoring and Optimization of an Autonomous Learning System Master dissertation Master in Informatics Engineering Dissertation supervised by Victor Alves Davide Carneiro September 2022
COPYRIGHT AND TERMS OF USE FOR THIRD PARTY WORK Name: Guilherme Fraga Palumbo Dissertation Title: Monitoring and Optimization of an Autonomous Learning System Mentors: Victor Alves, Davide Carneiro Conclusion Year: 2022 Master Designation: Master in Informatics Engineering I declare that I grant to the University of Minho and its agents a non-exclusive license to file and make available through its repository, in the conditions indicated below, my dissertation, as a whole or partially, in digital support. I declare that I authorize the University of Minho to file more than one copy of the dissertation and, without altering its contents, to convert the dissertation to any format or support, for the purpose of preservation and access. Furthermore, I retain all copyrights related to the dissertation and the right to use it in future works. I authorize the partial reproduction of this dissertation for the purpose of investigation by means of a written declaration of the interested person or entity. This is an academic work that can be used by third parties if internationally accepted rules and good practice with regard to copyright and related rights are respected. Thus, the present work can be used under the terms of the license indicated below. In case the user needs permission to be able to make use of the work in conditions not foreseen in the indicated licensing, he should contact the author through the RepositóriUM of the University of Minho. LICENSE GRANTED TO USERS OF THIS WORK: CC BY-NC-ND https://creativecommons.org/licenses/by-nc-nd/4.0/ i
ACKNOWLEDGEMENTS First and foremost, I would like to praise and give glory to God, the almighty, who has granted countless blessings, knowledge, and opportunities, so that I have finally been able to accomplish the thesis. I would like to deeply thank Professor Davide Carneiro for all the support he gave me throughout the period of execution of this dissertation. I thank you for everything you conveyed to me, from motivation, availability, mentorship, and friendship. I am grateful for the faith the Professor has placed in me. I also thank in a special way Professor Victor Alves who collaborated and helped me in the development of this dissertation. To CIICESI Research Center for creating the conditions for this dissertation to be completed. A big thank you to my team, without your help I wouldn’t be able to do it. My deep and heartfelt gratitude to all my family, Brasil, Roselaine, Henrique and Leonardo, for their outstanding education and, most importantly, for their unconditional love and support. To all, my sincere thanks. ii
STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho. iii
ABSTRACT In the last years, the number of Machine Learning algorithms and their parameters has increased significantly. This allows for more accurate models to be found, but it also increases the complexity of the task of training a model, as the search space expands significantly. As datasets keep growing in size, traditional approaches based on extensive search start to become costly in terms of computational resources and time, especially in data streaming scenarios. With this growth, new challenges in Machine Learning started to appear. The speed at which data arrives and different ways of storing data are forcing organizations to address and explore new ways of adapting fast enough so their ML models don’t become obsolete. This dissertation aims to develop an approach based on meta-learning that tackles two main challenges: predicting the performance metrics of a future model and recommending the best algorithm/configuration for training a model for a specific Machine Learning problem. Throughout this dissertation, all the study objectives and questions, along with the relevant contextualization will be exposed. The proposed solution, when compared to an AutoML approach is up to 130x faster and only 2% worse in terms of average model quality, showing it is a good solution for scenarios in which models need to be updated regularly, such as in streaming scenarios with Big Data, in which some accuracy can be traded for a much shorter model training time. K E Y W O R D S Machine Learning, Meta-Learning, Optimization, Monitoring, Algorithm Recommendation. iv
RESUMO Nos últimos anos, o número de algoritmos de Machine Learning e seus parâmetros aumentou significativamente. Isso permite que modelos mais precisos sejam encontrados, mas também aumenta a complexidade da tarefa de treinar um modelo, pois o espaço de busca expande-se significativamente. À medida que os conjuntos de dados continuam a crescer em tamanho, abordagens tradicionais baseadas em uma pesquisa extensiva começam a se tornar caras em termos de recursos computacionais e tempo, especialmente em cenários de streaming de dados. Com esse crescimento, novos desafios no Machine Learning começaram a aparecer. A velocidade com que os dados chegam e as diferentes maneiras de armazenar dados estão a forçar as organizações a abordar e explorar novas formas de se adaptar rápido o suficiente para que os seus modelos de ML não se tornem obsoletos. Esta dissertação visa desenvolver uma abordagem baseada em Meta-Learning que aborda dois desafios principais: prever as métricas de desempenho de um modelo futuro e recomendar o melhor algoritmo/configuração para treinar um modelo para um problema específico de Machine Learning. Ao longo desta dissertação, serão expostos todos os objetivos e questões do estudo, juntamente com a contextualização relevante. A solução proposta, quando comparada a uma abordagem AutoML é até 130x mais rápida e apenas 2% pior em termos de qualidade média do modelo, mostrando que é uma boa solução para cenários em que os modelos precisam ser atualizados regularmente, como em cenários de streaming com Big Data, em que alguma precisão pode ser negociada por um tempo de treino de modelo muito menor. PA L AV R A S -C H AV E Aprendizagem Automática, Meta Aprendizagem, Otimização, Monitorização, Recomendação de Algoritmos. v
CONTENTS 1INTRODUCTION AND MOTIVATION ........................... 3 1.1 Objectives ..................................... 3 1.2 Working Methodology ............................... 4 1.3 Dissertation Outline ................................ 5 2CONTEXTUALIZATION .................................. 6 2.1 The NEURAT Project ................................ 6 2.2 Machine Learning ................................. 8 2.3 Meta-learning .................................... 14 2.4 Related work .................................... 16 3PROPOSED SOLUTION ................................. 20 3.1 Development of the meta-model .......................... 21 3.2 Algorithm ranking .................................. 27 3.3 Integration ..................................... 30 3.4 Monitoring ..................................... 31 4E VA L UAT I O N ....................................... 37 4.1 Methodology .................................... 37 4.2 Development of the meta-model .......................... 38 4.3 Algorithm Recommendation ............................ 44 5CONCLUSION ....................................... 53 5.1 Limitations ..................................... 53 5.2 Main contributions ................................. 53 5.3 Scientific contributions ............................... 55 5.4 Awards ....................................... 55 5.5 Future work ..................................... 56 References .......................................... 57 vi
LIST OF FIGURES Figure 1 NEURAT’s system functionalities and data flow ............... 6 Figure 2 Fundamental representation of an Algorithm ................ 10 Figure 3 Long-Short-Term-Memory cell [38]..................... 18 Figure 4 Main steps followed to train and validate the meta-model. .......... 23 Figure 5 Algorithms with all possible 49 configurations. ............... 25 Figure 6 Form the user fills to use the algorithm recommendation system. ...... 28 Figure 7 Available performance metrics the user can choose from. .......... 28 Figure 8 Example of results of the algorithm recommendation ranking. ........ 29 Figure 9 Graphical representation of the built environment done using Docker. .... 31 Figure 10 Overview of the dashboard to analyze each variable. In this case the models performance metrics are a mean of all results of all variables. ........... 33 Figure 11 Dashboard (line charts) representing the results of the variable f10 over a specific period of time. ............................... 33 Figure 12 Dashboards showing a bar chart of the number of runs per day and a table of the sum of runs for each variable. ....................... 33 Figure 13 Line chart of both training results and validation results of R2for each variable. 34 Figure 14 Line chart of both training results and validation results of RMSE for each variable. 34 Figure 15 Dashboard showing the top 5 of the last meta-features registered by the system for each variable. ............................... 34 Figure 16 Dashboards showing the results over time of the best meta-feature, both visually and in a table. ................................. 34 Figure 17 Dashboards showing the results over time of the second best meta-feature, both visually and in a table. ........................... 35 Figure 18 Table showing in a time line the last added top 5 meta-features for each variable. 35 Figure 19 Dashboard comparing RMSLE results with the variation of the top 5 meta-features over time. ................................. 35 Figure 20 Dashboard comparing RMSE results with the variation of the top 5 meta-features over time. .................................... 36 Figure 21 Dashboard comparing RMSE results of the variable f10 with the variation of the top 5 meta-features over time. .......................... 36 Figure 22 Comparison between predicted RMSE versus observed RMSE for several different ML test problems .............................. 42 vii
• (6) Communication. Activity intended to communicate the problem and the artifact. It is also used as guidance to structure the paper of a scholarly research publication. 1.3 DISSERTATION OUTLINE This document is composed of four main sections. Section 2is divided into three subsections, the NEURAT Project (2.1) where a part of the work is inserted, Machine Learning (2.2) where is introduced the scientific concepts related to Machine Learning and meta-learning (2.3) where is presented scientific ideas about meta-learning and some related work relative to the project at hand are provided. Section 3will address a proposed solution for the monitoring and optimization of an autonomous learning system, the main topic of this dissertation. In Section 4is presented the methodology, describing how the proposed solution was evaluated and the results of said solution. This dissertation ends with section 5dedicated to analyzing, among other considerations, if the objectives were or were not accomplished based on the proposed solution. 5
2 CONTEXTUALIZATION 2.1 THE N E URAT PROJECT Part of this disseration is inserted in a subsection of a system developed in the context of the NEURAT project.1, whose primary goal is to support human auditors in carrying out financial fraud detection. The main functionalities of the system and the data flow are summarized in Figure 1. Figure 1: NEURAT’s system functionalities and data flow 1 The website of the NEURAT project is available at https://neurat.pt/ 6
The NEURAT project starts with the extraction of data from SAF-T files. SAF-T, which stands for Standard Audit File for Tax purposes, is a standard the OECD maintains to exchange electronic accounting data between organizations, tax authorities, or external auditors. The measure was adopted in Portugal in 2008. The extracted data goes through Colbi, a tool developed by SOVOS Petapilot that checks the compliance of the files with the SAF-T and with OECD’s audit guidelines. This is implemented through a rule-based system and generates sets of so-called findings ranging from syntax errors in the SAF-T to potential fraud positives. This step’s main disadvantage is that it is rule-based, thus static, and does not learn from the auditor’s actions. For instance, a given rule may fire if the sum of two columns is not equal. However, upon inspection, the auditor concludes that the difference is minimal due to a known rounding error in a given ERP. This rule will, most likely, fire dozens or even hundreds of times throughout the SAF-T files. Nonetheless, the auditor must label all these instances as false positives. The main goal of the developed system is to learn from the knowledge and actions of the auditors so that, throughout time, the system’s accuracy in identifying positives keeps increasing. This will allow auditors to focus increasingly on the relevant cases since the system will deal with the repetitive ones. This is important as fraud detection is carried out by sampling, given the significant number of transactions that occur each year and the limited number of auditors. The likeliness of auditors finding true positives will thus increase. The data obtained from the Colbi platform is stored in the so-called Unlabeled dataset. This contains the instances that an auditor has not yet reviewed. The auditor then selects one particular instance to audit, analyses it, provides feedback, and saves it. When this process ends, the instance is moved from the Unlabeled to the Labeled dataset. Moreover, the process of instance selection by the auditor may be influenced by the goal of leading the auditor to provide feedback on instances that would give the system more knowledge (e.g., instances that are "more different" from the already labeled ones). The auditor can also contribute knowledge by suggesting new features to be included in the pipeline. These are the so-called dynamic features, as opposed to the traditional static features extracted from the SAF-T files. Since these dynamic features cannot, in most cases, be directly extracted from the SAF-T, a Machine Learning model is maintained to predict the value of each one in the unlabeled data. Thus, with time these humansuggested features are included in the system, and their values are predicted by ML models, which the auditors only have to validate. This means that multiple models are maintained in the system: the main one that predicts the likeliness of fraud of an instance and one model for each dynamic feature in the pipeline. Since the labeled data changes throughout time, as the auditors do their work, these models must be updated regularly. However, the fact that new data exists does not necessarily mean that there will be new patterns: the new data may be very similar to the existing one. We use meta-learning to address this issue and avoid re-training models when their performance might not improve. The focus of this dissertation allows the system to only re-train a new model if some of the performance metrics of the current model are expected to change by a minimum threshold. The system will re-train a new model based on the best model recommended by the solution. To this end, we use a large group of meta- 7
features that describe different data characteristics and a meta-model trained with data from dozens of diverse ML problems. Finally, the system also includes an Explanation Interface. The main goal of this interface is to provide auditors with an intelligible explanation for each prediction done by the system. For every feature whose value has been predicted by a model and not yet validated by an auditor, there is an accompanying explanation that is symbolic in the sense that it uses the domain’s concept and relies on simple and familiar statistics concepts. The explanation is designed to give the auditor confidence in the prediction provided by the system. 2.2 MACHINE LEARNING Machine Learning is becoming one of the most popular branches of study and development of Artificial Intelligence. Since the very early stages of humankind, we see different ways people have tried to simplify their work, either by using animals to help plant crops or by developing the wheel to transport things more easily. Since the beginning, humans have always tried to achieve the best results in the fastest and the easiest way possible, it’s in our nature. Likewise, Machine Learning emerged to study, engineer, provide and improve mathematical models, adopting a statistical learning approach, which can be trained with context-related data to infer the future and to make decisions without complete knowledge of external factors and influencing elements. The Machine Learning goal is to attempt to determine the proper probability distributions and use them to compute values or decisions that are most likely to be successful, which are the ones with the slightest error [13]. Types of Machine Learning Supervised Learning Supervised Learning is a type of Machine Learning that focuses on learning from a training dataset composed of many training examples and independent variables. With the training dataset, build a predictive model. All of those training examples have a well-defined label, the dependent variable, which is the desired output of the model [72]. It means that in Supervised Learning, our input data and the outcome are known and well-defined, meaning the algorithm can learn a function to map the data while a trainer supervises the learning process of the mapping. In summary, if a predictive model has a well-defined training dataset and a known label we call it a supervised learning model. Supervised Learning can be divided into two sub-categories, Classification and Regression. Depending on the label, the dependent variable is characterized, being that the label can be either quantitative or qualitative. Suppose the variable is qualitative (also referred to as categorical), like the gender (male or female) or someone’s hair color (brown, black, or blonde). In that case, we face a classification problem since, in classification, the label indicates the class to which the training example belongs. Classification algorithms can be used for diagnosis, fraud detection, image classification, customer loyalty, etc. 8
If the variable is quantitative, taking on numerical values, like the number of children (discrete) or persons’ age or height (continuous), we face a regression problem. In regression, the label is a real-value response corresponding to the example. Regression algorithms can predict population growth, market forecasts, weather forecasts, average life expectancy, etc. Unsupervised Learning In Unsupervised Learning, there is no training set for the algorithm. While they have input data, there is no corresponding label or result [41], and no known dependent variable. In this type of Learning, the algorithms are provided with input data and have to interpret and learn from it independently. The purpose of this type of Learning is to model the structure, distribution and to find hidden patterns in the data of the problem [52]. Unsupervised Learning can be divided into two sub-categories, Association and Clustering. Association algorithms are used for finding relations between variables in large databases. Typically used when there is a need to know rules that associate with the behavior demonstrated by the data. Association algorithms can be used for meaning understanding, big data, the discovery of structures, attribute selection, etc. When the goal is to find natural groups and patterns and organize the input data into coherent groups, clustering algorithms are used. Clustering algorithms can be used for customer segmentation, marketing, recommendation systems, etc. [14]. Reinforcement Learning Reinforcement Learning algorithms use self-feeding techniques to improve results, influenced by the notion of reward/penalty. The machine learning algorithm is not told which actions it should take, but its objective is to try each action to find which one will provide the best results [41]. According to Sutton and Barto [63], Reinforcement learning problems involve learning what to do—how to map situations to actions—so as to maximize a numerical reward signal. In an essential way they are closed-loop problems because the learning system’s actions influence its later inputs. Moreover, the learner is not told which actions to take, as in many forms of machine learning, but instead must discover which actions yield the most reward by trying them out. Reinforcement Learning is used in topics like games that use Artificial Intelligence, acquisition of skills, robot navigation, real-time decisions, learning tasks, etc. Algorithms An algorithm is a set of instructions or a specific procedure for solving a well-defined computation problem or accomplishing a task [10]. Algorithms are specifications for performing calculations, data processing, automated reasoning, automated decision-making, and other tasks. Algorithms are like a recipe composed of specific 9
instructions so that a computerized device can use them to cut the time required to do things manually. Algorithms allow workers to be more efficient and focused, making slow processes more proficient and faster [26]. At a fundamental level of description, we can represent an algorithm as a set of instructions that manipulate input to produce an output (Figure 2). Figure 2: Fundamental representation of an Algorithm An algorithm’s characteristic traits are well-defined inputs and outputs and clear and unambiguous instructions, where each of its steps should be clear in all aspects and must lead to only one meaning. An algorithm should also be language-independent, meaning its instructions can be implemented in any language if needed, always resulting in the same output, be feasible (simple, generic, and practical) and have definite or definable limits [58]. Although there are slightly distinct versions and no well-defined standards for designing an algorithm, since each algorithm needs to satisfy a specific set of requirements depending on the problem, it is possible to summarize the algorithm design process in a few steps [26,28,39,58]: •Problem description: The goal is to describe and understand the problem, usually in mathematical terms. •Plan a solution: The goal is to find how the algorithm will solve said problem. A plan is developed to determine the starting and ending points for solving the problem. •Algorithm Development: This step concerns designing the algorithm itself, which includes the central part of a solution. This is where the established input and details for the computer to carry out the solution are added. •Testing: In this step, the solution (algorithm) is tested repeatedly to analyze its performance, accuracy, efficiency, and other evaluation metrics. This step aims to analyze and evaluate if the algorithm is giving the desired output and results; reviews, adjustments, refinements, and evaluations are made to ensure that the algorithm provides the best solution to the problem presented. Nowadays, there are numerous Machine Learning algorithms, each with distinct characteristics, to solve a specific set of problems. Those algorithms can be grouped based on their similarity in terms of their function with each other. For instance, a Linear Regression and a Logistic Regression algorithm can be grouped in a Regression algorithms group, k-Nearest Neighbor and Support Vector Machines in Instance-based algorithms, Naive Bayes, and 10
Bayesian networks in Bayesian algorithms. Recurrent Neural Networks and Long Short-Term Memory Networks in Deep Learning Algorithms, Random Forests and Gradient Boosting Machines in Ensemble Algorithms, and so forth. These grouping methods are structured to guide machine learning experts to centralize their needs and to facilitate the decision regarding which ML algorithm is best for a specific problem, even though these grouping methods are not perfect and some algorithms can fit in more than one group. The five tribes of Machine Learning Instead of tackling each group individually, we can look at the work of Pedro Domingos, author of the book "The Master Algorithm: How the Quest for the Ultimate Learning Machine Will Remake Our World" [25], in which he defines the five different tribes of machine learning all driven on building learning machines. According to Domingos, one of the world’s leading machine learning experts and a renowned professor at Washington University, about five different core methods are involved in modern Machine Learning. Domingos divides machine learning experts into a set of "tribes", the symbolists, connectionists, evolutionaries, bayesians, and analogizers. Each tribe has a set of core convictions and is focused on a particular problem that concerns them the most. What distinguishes them from each other is how they approach machine learning from different disciplines and, therefore, how they apply and come up with different algorithmic solutions [9]. The Symbolists Symbolists view learning as the inverse of deduction and take ideas from philosophy, psychology, and logic, meaning they use inverse deduction algorithms to find out what knowledge is missing in order to make a deduction go through and then make it as general as possible [25]. Symbolists affirm that all intelligence can be reduced to manipulating symbols, just like a mathematician solves equations by replacing expressions with other expressions. In conclusion, instead of starting with the premise and looking for the findings, symbolists use inverse deduction, where they begin with some assumptions and conclusions and essentially work backward to fill in the gaps [40]. The Connectionists Connectionists aim to reverse engineer the brain since the brain is constantly learning and is inspired by neuroscience and physics. They focus on the back-propagation algorithm. The algorithm concentrates on bringing the system output closer to the desired one by comparing the system output with the desired one and, afterward, changing the connections between layers of neurons in a way the desired result gets closer to what it should be [25,40] . The Evolutionaries Evolutionaries use genetic programming algorithms; their goal is to simulate natural evolution on the computer. They based their work on genetics and evolutionary biology. According to Domingos [40], evolutionaries apply the idea of genomes and DNA in the evolutionary process to data structures . 11
The key problem that evolutionaries solve is learning structure: not just adjusting parameters, like backpropagation does, but creating the brain that those adjustments can then fine-tune. the evolutionaries’ master algorithm is genetic programming, which mates and evolves computer programs in the same way that nature mates and evolves organisms. (Domingos, 2018). They assume that since natural selection developed the human race and all its complexity, we should simulate it on the computer. Genetic programming is an algorithm that uses a population of unfit programs fit for a particular task by applying operations equivalent to natural genetic processes to the population of programs. The Bayesians Bayesians believe Learning is a form of probabilistic inference, commonly named Bayesian inference, and has its roots in statistics. They affirm that there is uncertainty in everything we learn and know. Therefore there is a need to calculate the probability of every piece of information being incorrect and update these probabilities based on new proven results [9]. Bayesians use Bayes’ theorem, its derivatives, and probabilistic inference as a solution to deal with uncertain, noisy, incomplete, and sometimes contradictory information. Fundamentally, bayesians work with suppositions, applying an "a priori" thinking, being positive that some outputs are more likely to happen. Based on that, they update said supposition as more data are being discovered [25,40]. The first anti-spam filters were developed, building on these principles. The Analogizers The analogy is fundamental in human reasoning, and it’s in everyday decisions. When facing adversity, a problem, or the necessity of making a decision, we tend to look at our past experiences and actions and try to remember what happened and how we responded to the adversity, so we can make an analogy and act over this new problem in a similar fashion. Analogizers are influenced by psychology and mathematical optimization. They focus on similarity-based Learning, using a support vector machine algorithm, an algorithm that learns by extrapolating from similarity judgments, figuring out which experiences it needs to remember and how to combine them to make new predictions. Domingos refers to it as "generalizing from similarity." Analogizers algorithm is used in most online recommendation engines present today [9,25,40]. Big Data Big data has become one of the most desired resources of the 21st century, and some even call it the new oil. Big data is a term used to describe the immense volume of digital data obtained by human activity, which is very difficult to manage using conventional data analysis tools. Big data can also be referred not only to the massive, complex, and rapidly evolving data but also to the tools and practices for analyzing, processing, and managing the data [5,30,65]. According to IBM data scientists, big data can be broken into four dimensions, which they call "the four V’s of Big Data": Volume, representing the dimension of the data that needs to be analyzed and processed; Variety, 12
illustrating the vast diversity of data types; Velocity, meaning how fast the information has to be generated, managed and streamed; and the last V, Veracity, representing both data quality and availability [12,24,49]. According to the definition (Garner, 2017) [29], "Big data is high-volume, high-velocity and/or high-variety information assets that demand cost-effective, innovative forms of information processing that enable enhanced insight, decision making, and process automation." Challenges of Machine Learning With the continuous growth of Machine Learning and Big Data, organizations began to develop ways to find the true potential of collecting data. Data are being collected at an unprecedented rate, but Machine Learning faces new challenges and obstacles with that evolution. These challenges generally derive from the large volume of data and the further implications they come with. However, volume is not the only challenge but also the need to learn from data that is not all in one physical location and distributed across many machines [56]. Unlike in the past, data is increasingly dynamic, constantly changing over time due to the velocity at which companies and society evolve nowadays, consistently producing hundreds of millions of data, roughly 2.5 quintillion bytes each day. Since data are no longer static, Machine Learning operations cannot be one-shot operations anymore, instead, they need to be a continuous task and constantly flowing. Therefore the goal is to achieve the best model for this new data since a static model would become discontinued and would not provide the best results possible [51]. While in the past, the bottleneck of a project was the amount of data available, now, although the data available isn’t a problem anymore, the limitations arise with the necessity of constantly adapting ML operations within a reasonable time. Training a single model became a task not so easy to execute costs wisely since its computational resources and time that are necessary for training aren’t insignificant anymore, and frequently, time is the most scarce resource when training a model, being one of the most significant constraints ML has [56]. Not only that, but nowadays, organizations need to make decisions faster. With that, ML needs to be prepared to show results in real-time to ensure it’s still a viable tool for decision-making operations in a more efficient way. A distinct challenge Machine Learning faces is concept drift. Concept drift refers to the change in the underlying problem’s relationships between input and output data over time [15]. According to Zliobaite et al.[73], concept drift is the event when a model built to analyze data becomes obsolete due to the continuous evolution of said data. In most challenging data analysis applications, data evolve over time and must be analyzed in near real time. Patterns and relations in such data often evolve over time, thus, models built for analyzing such data quickly become obsolete over time. In machine learning and data mining this phenomenon is referred to as concept drift. Another challenge of Machine Learning is its bias. Bias in data may have very different sources (e.g., selection bias, lack of meaningful features). Still, it can generally be defined as data that is not representative of the 13
phenomenon being studied. As a result, data will often encode a prejudice, evident or not, against a part of the phenomenon (e.g., a particular group of people). The main consequence is that ML models will also be biased and, thus, discriminatory. Contrary to other domains, bias in fraud detection does not result from any form of prejudice: data are naturally biased since fraudulent instances are, fortunately, far less frequent than non-fraudulent ones (the ratio of imbalance can be as severe as 0.062 [59]). If bias in the dataset is not adequately dealt with, any ML model will most likely predict every instance it is given as not fraudulent. Most approaches to deal with class imbalance revolve around variations or combinations of undersampling (removing instances of the over-represented classes) or oversampling (replicating the under-represented instances), in which the cases to over or under-represent are selected randomly. Other more complex techniques exist, such as SMOTE [53] or ADASYN [34]. Krawczyk et al. [42] resumed the most significant challenges Machine Learning faces in the new era of information, those being: • The limited computational resources, such as memory and time, and consequently the need to make predictions in reasonable time; • Concept drift, where, for instance, data distribution could change in the stream over time, deteriorating the performance of the model, and; • The speed at which the data arrives may delay or even make it impossible to label all the items; • The data that is not representative of the phenomenon being studied (bias). 2.3 META-LEARNING To understand more about what meta-learning is, we first need to comprehend what Meta refers to. Meta typically means raising the level of abstraction, transcending or above, and often refers to information about something else. Meta-mathematics, for example, is the study of mathematics using mathematical methods. Meta-data, a term employed frequently throughout the dissertation, is an expression used to represent data about data, meaning we use data to explain more data, enriching it with information that makes it easier to find, use and manage. For example, meta-data can be the data about the data stored in a file, such as the name of the file, its size, the date when it was created, the type of file, the path to the file, and any other kind of information referred to the data within the file. In other words, meta-data is not the data stored in the file itself but the data that explains that data. Knowing what meta stands for and understanding meta refers to something explaining something in Machine Learning, we have a term called meta-learning. Meta-learning, or learning to learn, is the science of continuously and systematically observing how distinct Machine Learning approaches perform on a wide range of learning tasks and then learning from this experience to learn new tasks much faster than otherwise possible. Not only does this dramatically speed up and improve the design of Machine Learning pipelines or neural architectures, but it also allows us to replace hand-engineered algorithms with novel approaches learned in a data-driven way [68]. 14
The goal is to accelerate and support decision-making tasks, automatically presenting which algorithm is most suitable for a given Machine Learning problem and, as a complement, a monitoring system to assess the evolution of the algorithms and data. The monitoring system will possess several graphics showing how all the metrics evolve, what meta-features impact the model the most, etc. This solution focus on the performance of meta-learning for algorithm recommendation of regression and binary classification datasets only since there was a lack of available public meta-dataset, the process of acquiring new datasets was too extensive, and the time for development was limited. The datasets used were selected to satisfy at least regression problems, so performance metrics like Accuracy, Confusion Matrix, Precision and Recall, F1-score, and AU-ROC were not considered. Nevertheless, the solution presented is designed to be flexible and can incorporate any type of meta-features and ML algorithms. 3.1 DEVELOPMENT OF THE META-MODEL To develop the meta-model, firstly, a total of 40 datasets from different ML problems were used (Table 1). Each dataset is composed of other characteristics to obtain a greater diversity of results and, consequently, a broader meta-model. These datasets are divided into two types, Regression and Binary Classification datasets, all of them with their unique number of records and a unique number of features. Table 1describes some of the data preparation done on the datasets where if some data preparation was done is illustrated with a Yand if not with an N. 21
Table 1: Characterization of the 40 datasets used for training the meta-model. (R: Regression, B: Binary Classification), (Y: Yes, N: No) Dataset Type N Features Remove Outliers Normalization 2015 R 159 10 N N 2017 R 156 10 N N 2017_full_report R 1420 16 N N 2018 R 157 8 N N 2019 R 157 7 N N 2020_full_report R 1848 19 N N 80111 R 132 6 N Y abalone_dataset R 4177 9 N Y bank_10000 B 10000 17 N N breast_cancer_wisconsin B 699 10 N N calories_9000 R 9000 8 Y Y cardio_vascular_10000 B 10000 12 N N CarPrice_Assignment R 205 24 N Y computer_hardware_dataset R 209 10 Y Y Concrete_Data_Yeh R 1030 9 Y Y countries_10189 R 10189 10 Y Y creditcard_1000 B 1000 30 N N forbes_billionaire_dataset R 2043 6 Y Y general_data B 4410 22 N N german_credit_data B 1000 21 N N Housing R 546 12 N Y housing_boston_medv R 506 14 N Y HR_Employee_Attrition B 1470 33 N N HRDataset_v14 R 311 30 Y Y insurance R 1338 7 N Y kc_house_4600 R 4600 19 N Y mcd_menu_scrubbed R 260 6 N Y meta R 528 22 N Y pima_indians_diabetes B 768 9 N N Real_estate R 414 8 N Y school_grades_dataset R 649 33 N N servo R 167 5 N N Social_Network_Ads B 400 4 N N star_menu_scrubbed R 242 7 N Y TV_Shows R 1427 8 N Y wdbc B 569 31 N N who_suicide_statistics_7000 R 7000 6 Y Y winequality_green_4500 R 4500 12 N N winequality_red R 1599 12 N N wpbc B 198 33 N N 22
So, after obtaining the 40 datasets to build the meta-model, the first step of this approach, described in Figure 4, consists in doing some data preparation, namely removing the outliers from some datasets, since it was concluded after some experiments that the outliers were not relevant and would adulterate the final results. Also, in data preparation, due to some datasets having missing values, some rows were eliminated from some datasets since the missing data couldn’t improve the model and was an obstruction to further development. One crucial aspect in constructing the meta-dataset must be noted: some performance metrics are scaledependent (e.g., RMSE). Without any transformation, they could not be used to compare the performance of models in different ML problems, only to compare other models for the same problem. Since there are different datasets in the pool of training datasets, to address this issue, the scale-dependent performance metrics, such as the RMSE, are normalized using the Interquartile Range of the dependent variable of the original dataset with the outliers removed, changing the observations so that they can be described as a normal distribution. This ensures that all the performance metrics are within a similar range. When the meta-model is used afterward, its prediction is de-normalized using the Interquartile Range of the target dataset. Figure 4: Main steps followed to train and validate the meta-model. 23
The second process of Figure 4is meta-feature extraction, so the meta-features are extracted for each dataset. As said previously, the meta-features can characterize the complexity of datasets and provide estimates of algorithm performance, allowing a comprehensive data characterization and a more in-depth data exploration for each dataset. For that, a meta-feature Extractor was used, developed by Alcobaça et al., which was designed to extract general properties able to characterize datasets [4]. This extractor aims to provide relevant evidence about the performance of algorithms allowing and backing the development of Recommendation Systems using meta-learning. Thus, the measures obtained by the meta-feature Extractor can predict the performance of the algorithms under evaluation with a low computational cost. According to the meta-feature Extractor, the meta-feature measures are divided into five groups [3]: •General - General information related to the dataset, also known as simple measures, such as number of instances, attributes and classes. •Statistical - Standard statistical measures to describe the numerical properties of a distribution of data and also the discriminant measures. •Information-theoretic - Particularly appropriate to describe discrete (categorical) attributes and their relationship with the classes. •Decision Tree Model-based - Measures designed to extract characteristics like the depth, the shape and size of a Decision Tree model induced from a dataset. •Landmarking - Represents the performance of simple and efficient learning algorithms. The extraction of all meta-features resulted in a total of 160 meta-features collected, describing the characteristics of each dataset used. These features represent a variety of aspects concerning each dataset, including measures of data quality (e.g., missing data, bias), shape (e.g., number of rows/columns, rows-columns ratio), statistical properties of the variables (e.g., mean kurtosis, mean skewness), information-theoretic (e.g., class entropy, mean entropy of attributes, noise-signal ration), among others. Following the extraction of meta-features, the next step is training the model for each configuration considered. Forty-nine (49) different models are trained for each dataset, containing all the considered arrangements of the four (4) algorithms used, as shown in Figure 5. 24
Figure 5: Algorithms with all possible 49 configurations. This process took into consideration the algorithms available in H2O, and algorithms like Stacked Ensemble or XGBoost were not used since Stacked Ensemble uses multiple learning algorithms to obtain better predictive performance, and XGBoost since the algorithm implements a process called boosting to yield accurate models. Boosting refers to the ensemble learning technique of building many models sequentially, with each new model attempting to correct for the deficiencies in the previous model [35]. Since both algorithms depend on using more than one learning algorithm, it goes against the purpose of the solution, meaning that although they would present good results, they do not fit the problem at hand. The algorithms used for the proposed solution were [35]: •Generalized Linear Model (GLM) - estimate regression models for outcomes following exponential distributions. In addition to the Gaussian (i.e., normal) distribution, these include Poisson, binomial, and gamma distributions. •Distributed Random Forest (DRF) - generates a forest of classification or regression trees rather than a single classification or regression tree. Each of these trees is a weak learner built on a subset of rows and columns. More trees will reduce the variance. Both classification and regression take the average prediction over all of their trees to make a final prediction, whether predicting for a class or numeric value. 25
•Deep Neural Networks (DL) - is based on a multi-layer feedforward (the connections between the nodes do not form a cycle) Artificial Neural Network (ANN) that is trained with stochastic gradient descent (an optimization algorithm for minimizing the loss of a predictive model concerning a training dataset) using back-propagation (an automatic differentiation algorithm for calculating gradients for the weights in a neural network graph structure). The network can contain many hidden layers consisting of neurons with tanh, rectifier, and maxout activation functions. •Gradient Boosting Machine (GBM) - builds regression trees on all the dataset’s features in a fully distributed way - each tree is built in parallel. For each algorithm described above, construction of different configurations was done, so the proposed solution is able to train several other models with several different results. Then, after the training for each configuration, a new collection of data is performed, where the meta-labels are extracted. This second group of features describes several performance metrics of models trained with the respective datasets (e.g., RMSE, MAE, R2), the training time and the algorithm used, and its configuration. Next, the meta-features are combined with the performance metrics of each model trained and the training time, creating a meta-dataset. Thus, each row in the meta-dataset represents an ML experiment performed on a dataset with given characteristics (meta-features), using a specific algorithm/configuration, which resulted in a model with the provided performance metrics. All in all, the meta-dataset is composed of 167 columns and a total of 1961 instances. Of the columns, 160 correspond to the meta-features extracted from the datasets, 1 corresponds to the algorithm and configurations of each row, while the remaining 6 correspond to relevant performance metrics: training time, RMSE, MAE, MSE, RMSLE, and R2. When this dataset is large enough, one of the multiple meta-models can be trained (one for each performance metric and training time). The meta-dataset is then used to build the meta-model, a model that learns from the given meta-features. But, before building the meta-model, the meta-dataset, goes through a process of Normalization by its IQR, in a way to make all results inside the Meta-datset comparable to a standard deviation. The interquartile range is the difference between the lower and upper quartiles. The purpose of the meta-model is to predict a performance metric (e.g., RMSE) given the characteristics of the ML problem. Thus, the developed meta-dataset can be used to train different meta-models: one for predicting each error metric considered and another for predicting training time when trained on a set of data with given characteristics. In order to decide on the algorithm for the meta-model and its best configuration, an extensive grid-search was performed, encompassing several state-of-the-art algorithms on top of the meta-dataset. The performance of the meta-model was evaluated using 5-fold cross-validation as described in Figure 4. The best model for the RMSE meta-model was a H2OGradientBoostingEstimator with a score_tree _interval = 5, ntrees = 99, max_depth = 17, min_rows =5, nbins = 20 and nbins_top_level = 1024. The RMSE of the resulting meta-model was 0.045 and the R2 was 0.953. Its most relevant meta-features that influence the meta-model are described in Table 2: 26
Table 2: Ten most relevant meta-features, out of 160 used to build the RMSE meta-model meta-feature Scaled Importance Description can_cor.mean 1 Mean of canonical correlations of data. attr_conc.sd 0.510 Standard deviation of concentration coef. of each pair of distinct attributes. attr_ent.mean 0.230 Mean of Shannon’s entropy for each predictive attribute. class_conc.sd 0.190 Standard deviation of concentration coefficient between each attribute and class. worst_node.mean.relative 0.150 Mean of performance of the single decision tree node model induced by the worst informative attribute. cat_to_num 0.110 Compute the ratio between the number of categoric and numeric features. class_conc.mean 0.105 Mean of concentration coefficient between each attribute and class. wg_dist.mean 0.105 Mean of weighted distance, that captures how dense or sparse is the example distribution. nr_inst 0.095 Compute the number of instances (rows) in the dataset. kurtosis.sd 0.095 Standard deviation of kurtosis of each attribute For the other performance metrics in a succinct way the results were (note that a meta-model was not developed for MSE since it’s directly correlated with RMSE, meaning just one model is necessary to calculate the Mean Square Error): • MAE - H2OGradientBoostingEstimator with rmse = 0.041 • R2 - H2OGradientBoostingEstimator with rmse = 0.072 • RMSLE - H2ODeepLearningEstimator with rmse = 0.036 • Time - H2OGradientBoostingEstimator with rmse = 1751.234 Each of the meta-models trained can thus be used to predict a specific performance metric, given the characteristics of an ML problem and an algorithm/configuration. The predictions made by the meta-models are then denormalized to improve reading performance of the concrete results. 3.2 ALGORITHM RANKING However, the development and creation of the meta-models is just the first step for the proposed solution. Once the meta-models were built, an algorithm ranking was then developed that, given an ML problem, returns the ranking of the best n algorithms/configurations to the user. The algorithm ranking was thought to be used when the user/system does not know which algorithm/configuration to use. The service thus acts as a recommendation system that, based on the meta-model, will suggest the best potential algorithms/configurations for the specific ML problem. The user only needs to train a sub-group of the best candidate models instead of carrying out an extensive search. The approach is intended to be used when there is no decision regarding which algorithm to consider: it suggests the best algorithms (e.g., top-5, top-10) for the given ML problem and provides an estimate of the expected performance. It is thus an algorithm recommendation system. The rationale is that, instead of using brute force or extensive search approaches, which take a considerable time and are computationally expensive, the user can train a small set of models: those suggested by the ranking service as being more promising. The objective of this proposed solution is, in other words, to, based on a new ML problem and, using the metamodel, retrieve the best Top-N algorithms and their configurations so the user can then train the best models for said specific ML problem. 27
So, a web application was created for the algorithm ranking, using React as the client side (front-end) and flask as the server side (back-end). This web application was designed to support and help any user or auditor to use our system, thus showing that it is not a solution tailored to a particular project but that it was thought and designed to be possible to apply the solution in any context and ML problem. This flask application consists mainly in a web page where the user can fill a form indicated in Figure 6. The algorithm ranking service accepts as input a dataset he wants to predict, its dependent variable, and the desired performance metric the user wants (e.g.training time, RMSE) (Figure 7). By selecting the performance metric chosen, the user selects the specific meta-model that the system will use to predict the best algorithms. The user also has to indicate the Top-N desired results and, finally, the percentage of train/test/validation split he wants to use. The user will choose the rate of dataset he intends to train, meaning test and validation will have the remaining percentage split by the two. After usage, a table will be generated with the Top-N best results based on the performance metric previously selected and the possibility for further use of the given results by pressing the button Use (Figure 8). Figure 6: Form the user fills to use the algorithm recommendation system. Figure 7: Available performance metrics the user can choose from. 28
Figure 8: Example of results of the algorithm recommendation ranking. On the server side, there are two main python/flask processes. The first one is where the entire ecosystem of the algorithm recommendation system is implemented. Firstly it extracts the meta-features from the input dataset and makes a series of requests to the corresponding meta-model to predict the desired performance metric for each available algorithm/configuration. These predictions took into account the Interquartile Range (IQR) of the dataset. Afterward, it sorts the algorithms/configurations by descending performance (the best to the worst) and returns the results to the user/system. This process is generally very efficient, given that the meta-model is already trained. The task of extracting the meta-features is, however, dependent on the size of the dataset, and significant changes in the execution time can be experienced. The second process is the usage of a given result based on the user choice, meaning the user is able to use, for example, the algorithm and configurations of the top 1 result to train, validate and predict for a given ML problem. In resume, instead of relying on computationally intensive and time-expensive search methods, by using this algorithm recommendation system, the user can thus only train the best candidate models suggested by the system for a given ML problem. The results of validation of the meta-model and validation of the algorithm ranking service are detailed in Section 4. 29
3.3 INTEGRATION Interactive Machine Learning Systems have particular characteristics of their own when compared to traditional, one-shot ones. Specifically, some challenges stem from the dynamic nature of the data: when the data change, so must, in principle, the models. Thus arises the question as to when and how to update models. For instance, should a model be re-trained entirely? Can the model be only partly updated? If so, to what extent and how? There are also trade-offs to take into consideration. For instance, a more dynamic approach in which models are updated frequently (e.g., with minor changes in the data) will react more rapidly to change, but it will also be more resource-intensive and more sensitive to noise. Doing the opposite, i.e., having a more extended time between updates, will require less computational resources but result in a system that might be operating with underperforming models in the sense that they may be partly outdated. The proposed system, rather than relying on static rules (e.g., based on the amount of new data, based on time intervals), relies on a prediction of the performance metrics of the potential new model. Since the existence of new data does not necessarily mean that there will be new patterns, or also, further data may be of poorer quality, be biased, or contain significant portions of missing values, which may decrease the quality of the new model, the proposed approach was integrated into a specific use case of the NEURAT project previously described in Section 2.1 to respond to the problems cited. The objective of this integration is to demonstrate that the proposed solution developed cannot only be used independently, as stated above but is also capable of being integrated into a system. This service determines whether a specific model should or should not be re-trained. Now, for this, and in order to respond to the needs of the project, the recommendation system was implemented on the existing process of the project. This process only trained a pre-defined model. However, with this integration, the process can constantly train the best model suggested by the ranking. In other words, the entire recommendation system was integrated into the project, replacing the only existing outdated process. The decision of whether or not to train a model may be triggered at regular intervals (e.g., at every 1000 new instances of data, at every 2 hours) or when some meta-features being observed change significantly. The system can calculate if the new performance metric, in this case, the RMSE or elapsed time, is predicted to be better than the current one. If the new performance metric is better than the present, a new model will be trained based on the best-suggested model by the ranking. That is, a given model is only updated or re-trained if its new version is expected to have a significantly different performance. This is done based on the intended configuration and algorithm and the training data’s current characteristics (i.e., meta-features). If there is a meta-model available, it is used as previously described. If not (e.g., when a new instance of the system is started), a new model is always trained, and the resulting data is added to the meta-dataset. When the meta-dataset reaches a minimum number of instances, the first meta-model is trained and will be used from then on. The process is described at the bottom right of Figure 1. 30
4 EVALUATION 4.1 METHODOLOGY In order to evaluate the proposed solution, two main criteria were taken into account: the accuracy of the metamodel in predicting the performance of the model, and second, the quality of the algorithm recommendation service. In the following section, the obtained results are described in detail. All datasets used for reporting the results are test datasets, i.e., they were not used for the training process of the meta-models. In this case, the datasets for this ML problem can be considered as a hold-out set. A total of 16 datasets were used, covering both regression (13 datasets) and classification (3 datasets) problems. Table 3describes them. Each of these datasets went through the same meta-feature extraction process as the training datasets, and,some of them also required additional data preparation. Table 3: Characterization of the 16 datasets used for testing and validating the meta-models. (R: Regression, B: Binary Classification), (Y: Yes, N: No) Dataset Type N Features Outliers (De)normalization 2016 R 157 11 N N Advertising R 200 4 N Y Auto_mpg_dataset R 398 9 Y Y BikeDetails R 974 7 Y Y CarDetails R 4025 8 Y Y CrimeIndex R 129 7 N Y Dataset_Facebook B 455 19 Y N Fish R 156 7 N Y Framingham_heart_disease B 4238 16 N N Forestfires R 454 13 N Y Fundamentals R 1392 79 Y Y Pharma_drug_spend_countries R 1036 6 Y Y LasVegasTripAdvisor R 408 20 N N Slump-test R 102 11 N Y Student-mat R 395 33 N N World_food_scrubbed B 774 11 N N 37
4.2 DEVELOPMENT OF THE META-MODEL As a means of determining the accuracy of the constructed meta-models, a series of tests and adjustments were conducted. The necessity for normalization, removing outliers, filling in missing information, and validating the models stemmed from the interpretation of the results in order to get them closer to what was anticipated. The quality of the meta-model was evaluated based on the difference between the performance metric predicted by the meta-model (e.g., RMSE, MAE, R2) and the performance metric seen when the actual model is trained. If the predicted performance metric is relatively close to the observed one, it indicates that the meta-model can accurately predict its performance metric, signaling that it is a good meta-model that can be utilized for the algorithm recommendation system. Given that certain performance metrics, such as RMSE, MAE, and RMSLE, are dependent on the order of magnitude of the dependent variable, it is possible for it to change substantially between applications, indicating that it is problem-dependent. For this reason, the inputs are normalized prior to being fed to the meta-model then denormalized after the prediction so that they may be compared with the actual values. Figure 22 summarizes the results of this analysis, where each dot represents the performance metric predicted by the meta-model for a given algorithm/configuration versus the observed performance metric. a) 2016 dataset b) advertising dataset 38
c) auto_mpg dataset d) BikeDetails dataset e) CarDetails dataset f) CrimeIndex dataset 39
g) Facebook dataset h) Fish dataset i) forestfires dataset j) framingham_heart_disease dataset 40
k) fundamentals dataset l) LasVegasTripAdvisorReviews dataset m) pharma_drug_spend_countries dataset n) slump_test dataset 41
o) student-mat dataset p) world_food_scrubbed dataset Figure 22: Comparison between predicted RMSE versus observed RMSE for several different ML test problems Figure 22 shows that different algorithms are best suited for different ML problems: for the 2016 dataset the best algorithm is the H2ODeepLearningEstimator but for the adverstising dataset the results shows the H2ORandomForestEstimator is closer to the true values, while for example, for the auto_mpg dataset both H2ODeepLearningEstimator and H2ORandomForestEstimator present similar predictions compared with the true observed values of RMSE. In a similar fashion, for the fundamentals it seems H2OGradientBoostingEstimator is the best algorithm producing the closest results of them all. In general, the final results illustrated in Figure 22 are satisfactory, since the performance metric RMSE predicted is relatively close to the observed one, indicating that the meta-model can reliably predict its performance metric. Although not all results will be presented in the dissertation to stop from extending further than needed, this procedure of evaluating meta-models was carried out for each performance metric and time as depicted in Figures 23 to 26. 42
a) 2016 dataset b) auto_mpg dataset Figure 23: Comparison between predicted MAE versus observed MAE for different ML test problems a) framingham_heart_disease dataset b) pharma_drug_spend_countries dataset Figure 24: Comparison between predicted R2versus observed R2for different ML test problems 43
a) 2016 dataset b) world_food_scrubbed dataset Figure 25: Comparison between predicted RMSLE versus observed RMSLE for different ML test problems a) 2016 dataset b) framingham_heart_disease dataset Figure 26: Comparison between predicted time versus observed training time for different ML test problems 4.3 ALGORITHM RECOMMENDATION Once the meta-model was validated and its performance was deemed adequate, the next step was to implement a recommendation system capable of predicting the best n algorithms for a given ML problem, as previously 44
described. The Recommendation System was validated by comparing it with an exhaustive method (H2O’s AutoML) and comparing their respective Top-N outcomes in terms of the algorithms utilized, their configurations, and the corresponding performance metrics. Notably, the usage of the Recommendation System does not imply the training of any model; it merely suggests possibly superior algorithms to use. The user may then choose to train one or several models. In this regard, it is significantly faster than brute-force alternatives such as AutoML, which need the training of dozens or hundreds of models. The two primary comparison criteria were performance metrics and the duration of the process. Given that stopping criteria had to be established for the AutoML process, it was decided to terminate it once 49 models had been trained. While other criteria could have been used, we did not resort to performance or time-based criteria, since this could eventually influence the outcome in our favor (e.g. by giving it a short amount of time to train). Allowing it to train the same number of models that we consider seemed to be the fairest approach. The AutoML technique additionally incorporated a stopping metric for each trained model; the training process was terminated as soon as the deviance (error metric) between iterations did not vary significantly (with a tolerance of 0.001). This means that if the model does not continue to improve, AutoML will terminate the training process early. 45
Table 4: Results obtained by the proposed approach for a top-5 scenario, compared with an AutoML approach. Proposed Approach Observed AutoML Top 5 Algorithm RMSE Time RMSE Time Algorithm RMSE Time 2016 1 DL 0.138 5 0.124 0.649 GLM 0.009 849 2 DL 0.155 0.090 0.463 GLM 0.027 3 DL 0.158 0.122 0.329 GBM 0.040 4 DL 0.163 0.160 0.112 DL 0.050 5 DL 0.168 0.150 0.051 DL 0.051 Advertising 1 DRF 2.562 5 1.642 0.490 GBM 1.247 887 2 DRF 2.575 2.568 0.260 DL 1.279 3 DRF 2.580 1.611 0.168 DL 1.290 4 DRF 2.716 1.664 0.085 DL 1.295 5 GBM 2.810 1.259 0.103 DL 1.305 Auto_mpg 1 DL 3.049 27 3.013 2.028 DRF 2.932 1308 2 DL 3.067 3.167 0.994 DL 3.043 3 DL 3.079 2.935 1.395 DL 3.100 4 DL 3.101 3.274 0.628 DL 3.141 5 DL 3.118 3.232 0.845 DL 3.208 BikeDetails 1 DL 10016.575 6 13389.506 0.307 DL 12654.665 1313 2 DL 10034.116 12594.816 0.404 DL 12768.678 3 DL 10038.943 13654.158 0.375 DL 12823.888 4 DL 10061.151 13167.705 3.087 DL 12922.949 5 DL 10128.001 13283.675 0.118 DL 13050.403 CarDetails 1 GLM 161894.199 191 237446.889 0.009 GBM 105934.185 3120 2 GLM 166275.186 237446.889 0.009 GBM 106015.763 3 GLM 166285.829 237446.889 0.010 GBM 106368.227 4 GLM 166686.696 237446.889 0.010 DL 106598.171 5 GLM 167147.930 237446.889 0.517 DL 106914.546 CrimeIndex 1 DL 10.006 4 12.310 0.620 DL 10.252 591 2 DL 10.081 13.207 0.039 DL 10.302 3 DRF 10.203 14.442 0.633 GBM 10.408 4 DRF 10.509 14.735 0.236 GBM 10.462 5 DRF 10.573 15.009 0.163 GBM 10.502 Facebook 1 GBM 0.437 4 0.485 0.312 DL 0.440 888 2 GBM 0.438 0.490 0.516 GBM 0.442 3 GBM 0.447 0.476 0.201 GBM 0.443 4 DRF 0.461 0.460 0.775 GBM 0.443 5 DRF 0.463 0.461 0.430 GBM 0.443 Fish 1 DL 123.007 4 48.801 0.246 DL 43.849 702 2 DL 126.604 50.164 0.079 DL 43.907 3 GBM 127.457 65.223 0.169 DL 44.267 4 GBM 127.531 65.321 0.111 DL 45.072 5 GBM 129.045 65.146 0.360 DL 45.472 Fr. heart disease 1 DL 0.378 9 0.358 4.521 GLM 0.343 1376 2 DL 0.380 0.362 4.125 DL 0.344 3 GBM 0.382 0.363 0.753 GBM 0.344 4 DL 0.383 0.351 3.388 GBM 0.344 5 DL 0.385 0.374 8.020 GBM 0.344 46
5 CONCLUSION This work deals with the challenge of using meta-learning for algorithm recommendation for regression and binary classification problems. For this purpose, the work was divided into two main areas: the development of the meta-model and Algorithm Recommendation using meta-learning, and the development of a Monitoring System to evaluate the progression of the models. In spite of the ambition of the proposed research, significant contributions were derived from this approach. 5.1 LIMITATIONS During the development of the dissertation, some research limitations were found. The lack of available public meta-datasets was one of the main drawbacks of this research project. In addition, the sluggish process of acquiring new datasets from public data sources to add to the already existing ones was time expensive, creating an unwanted time constriction to the entire development process. As a result of this manual work, the metadataset created was not really extensive. Consequently, due to the lack of a diversified pool of datasets, the focus of this dissertation had to be directed to only regression problems. Not only that, but some classification datasets had to be modified so that they exhibited characteristics of binary classification problems, allowing them to be utilized in the meta-model. Other constraints encountered throughout the development of the meta-model was due to the fact of the limitation of available algorithms and configurations of the framework used. Although, an increase in algorithm quantity would be even more time expensive when building the meta-model. In addition, the necessity of a significant amount of computational time and resources for the extraction and generation of meta-features, as well as the training of all the algorithms and configurations, were an impediment to the development of a larger and more suitable solution. 5.2 MAIN CONTRIBUTIONS This research led to general contributions to the field of Machine Learning and meta-learning. Next, we summarize the main contributions of this dissertation. 53
Despite recent advancements in Machine Learning, particularly in terms of algorithms and computational resources, there are still substantial obstacles to overcome. The number of Machine Learning algorithms and their parameters has expanded dramatically in recent years. On the one hand, this enables the development of more precise models. On the other hand, it dramatically increases the complexity of training a model as the search space widens. As the size of datasets also grows in volume and the velocity at which it changes, traditional approaches based on extensive search start to become prohibitively expensive and limited in terms of computational resources and time. Simultaneously, there are fewer human experts who can typically address these issues using their experience and intuition. Moreover, the distribution of incoming data varies over time, which deteriorating the performance of the models. In addition, the speed at which the data arrives is a barrier to the labeling of the items, and the bias of the data may suggest that it is not representative of the phenomenon. While corporations are rapidly adopting new automated ML tools, they typically require significantly more computational resources than more traditional human-centered approaches since they rely on brute force or extensive search strategies. In this dissertation, an approach based on meta-learning that tackles these challenges is proposed. For that, a recommendation system was developed that will recommend the best n algorithm/configuration for training a model for a specific Machine Learning problem. The user can then direct her/his search towards this group of candidate algorithms instead of searching the whole search space. While the user still needs to actually train the models after they are suggested, only the top candidate models will be trained, as opposed to the significant number of models trained by AutoML or similar approaches. Moreover, the user may decide on training more or less models, depending on the circumstances, knowing all the time that they are the best candidate models that will be trained. In summary, when compared to an AutoML state of the art system, considering the elapsed time, the proposed approach is up to 130x faster in a scenario in which the user only trains the best model suggested by the recommendation service. In a scenario in which the user decides to train the best 5 models, the proposed approach is 96x faster on average. This is explained by the lack of a necessity to train a large number of models, as opposed to exhaustive approaches such as AutoML. Indeed, most of the time, the feature extraction process is longer than ranking the algorithms and training the top 5. This, of course, depends both on the complexity of the dataset and of the suggested models. The proposed approach is also only 2% worse in terms of average model quality, showing that it is possible to do this very satisfactorily in what concerns the error metric of the models and in a much faster time than automated approaches such as AutoML. Hence, the proposed approach is especially suited for scenarios in which models need to be updated regularly and quickly, such as in streaming scenarios with Big Data. In such cases, there is often no time for running extensive search approaches or the cost of doing so is simply prohibitive. 54
With the proposed approach, some accuracy can be traded for a much shorter model training time. This also translates into significant savings in terms of infrastructure and/or energy services, which have not been accounted for in this work. There is still room for improvement, as long as the major limitations are addressed, but while the meta-model will be further improved with more models and datasets, these results are very satisfactory, showing that this is a valid and promising path to follow towards the development of more efficient ML pipelines. 5.3 SCIENTIFIC CONTRIBUTIONS One of the main objectives in the elaboration of this dissertation was to share the work developed and the lessons learned, as well as to contribute to the expansion of knowledge regarding meta-learning and its applications. In this regard, efforts were made to promote the various developments by submitting scientific articles to international conferences. The following are the three articles produced during this dissertation’s research: • Palumbo G., Guimarães M., Carneiro D., Novais P., Alves V. (2022) Real-time algorithm recommendation using meta-learning. ISAMI’22: 13th International Symposium on Ambient Intelligence University of L’Aquila, L’Aquila, Italy, July 13-15, 2022 • Carneiro, D., Sousa, M., Palumbo, G., Guimarães, M., Carvalho, M., Novais, P. (2022) Continuously Learning from User Feedback. In World Conference on Information Systems and Technologies (pp. 579- 588). Lecture Notes in Networks and Systems, Springer, Cham. https://doi.org/10.1007/978-3-031-04826- 5_57 • Palumbo G., Carneiro, D., Guimarães M., Alves V., Novais, P. (2022) Algorithm Recommendation and Performance Prediction using Meta-Learning. Submitted to the International Journal of Neural Systems (IF 6.325, Q1 Computer Networks and Communications, Q1 Medicine (miscellaneous)) (accepted for publication) 5.4 AWARD S • Palumbo G., Guimarães M., Carneiro D., Novais P., Alves V. (2022) Real-time algorithm recommendation using Meta-Learning. ISAMI’22: 13th International Symposium on Ambient Intelligence University of L’Aquila, L’Aquila, Italy, July 13-15, 2022 This work was awarded the ELECTRONICS JOURNAL MDPI BEST PAPER award, attributed to a selection of the Program Committee of MIS4TEL, PAAMS, DCAI, BLOCKCHAIN, ISAml, PACBB, DECON conferences held in L’Aquila (Italy), from July 13th to 15th, 2022. 55
5.5 FUTU RE WORK In the context of Chapter 3, different improvements can be considered for future work, such as adapting of the current code by replacing the current framework with something like scikit-learn, where it is possible to train and test additional algorithms and configurations, thereby expanding the number of potential use cases. Although the meta-dataset created in this dissertation was focused only on regression and binary classification datasets, it would be interesting to extend the same methodology to other types of ML problems, such as e.g., multiclass classification, clustering. Accordingly, new evaluation metrics must be investigated. Furthermore, adding a few hundred more datasets to the meta-dataset will result in a more complete metamodel and, as a result, even better predictive results for current and future ML problems. Improvements can also be made to the creation of the meta-model through the use of artificial datasets, as more artificial datasets result in an increase in the number of meta-features and a larger meta-dataset. Consequently, a mixture of real and artificial datasets is a potential enhancement that can be made. Even though the meta-model will improve as more models and datasets are introduced, these results demonstrate that this is a valid and promising method for improving the performance of ML pipelines. Therefore, future work that can be implemented to improve the proposed solution is to develop an ML pipeline that can receive and process new datasets submitted online by the users to the meta-models. In addition, the ability to process data from streaming and batch will boost the performance of the meta-models even further. 56
REFERENCES [1] Abbasi, A., Albrecht, C., Vance, A., & Hansen, J. (2012). Metafraud: A meta-learning framework for detecting financial fraud. MIS Quarterly,36, 1293–1327. https://doi.org/10.2307/41703508 [2] Achille, A., Lam, M., Tewari, R., Ravichandran, A., Maji, S., Fowlkes, C. C., Soatto, S., & Perona, P. (2019). Task2vec: Task embedding for meta-learning. Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV). [3] Adriano, R., Luis, P. F. G., & Andre, C. P. L. F. C. (2020). Mfe: Meta-feature extractor. https://cran.rproject.org/web/packages/mfe/vignettes/mfe-vignette.html [4] Alcobaça, E., Siqueira, F., Rivolli, A., Garcia, L. P. F., Oliva, J. T., & de Carvalho, A. C. P. L. F. (2020). Mfe: Towards reproducible meta-feature extraction. Journal of Machine Learning Research,21(111), 1–5. http://jmlr.org/papers/v21/19-348.html [5] Alharthi, A., Krotov, V., & Bowman, M. (2017). Addressing barriers to big data. Business Horizons,60(3), 285–292. https://doi.org/https://doi.org/10.1016/j.bushor.2017.01.002 [6] Antoniou, A., Edwards, H., & Storkey, A. (2019). How to train your maml. [7] Barrett, C., & Bessho, T. (2020). Hyperparameter optimization using grid search for use in monocular depth estimation. Cat vehicle 2020 technical reports. [8] Baskerville, R. L., Kaul, M., & Storey, V. C. (2015). Genres of inquiry in design-science research: Justification and evaluation of knowledge production. MIS Quarterly,39(3), 541–564. https://www.jstor.org/ stable/26629620 [9] BBVA. (2016). The five tribes of ‘machine learning’. https://www.bbva.com/en/five-tribes-machine- learning/ [10] Belford, G. G., & Tucker, A. (1999). Algorithms and complexity. https://www.britannica.com/science/ computer-science/Algorithms-and-complexity [11] Bierstaker, J. L., Brody, R. G., & Pacini, C. (2006). Accountants perceptions regarding fraud detection and prevention methods. Managerial Auditing Journal,21(5), 520–535. https : / / doi . org / 10 . 1108 / 02686900610667283 [12] Bigdataframework. (2019). The 4 characteristics of big data. Enterprise Big Data Framework.https://www. bigdataframework.org/four-vs-of-big-data/ [13] Bonaccorso, G. (2017). Machine learning algorithms. Packt Publishing Ltd. 57
[14] Brownlee, J. (2020a). 10 clustering algorithms with python. https://machinelearningmastery.com/clusteringalgorithms-with-python/ [15] Brownlee, J. (2020b). A gentle introduction to concept drift in machine learning. https://machinelearningmastery. com/gentle-introduction-concept-drift-machine-learning/ [16] Brownlee, J. (2020c). What is meta-learning in machine learning? https://machinelearningmastery.com/ meta-learning-in-machine-learning [17] CabotICREA, J. (2013). The mda (model-driven architecture) foundation model. [18] Carneiro, D., Veloso, P., Ventura, A., Palumbo, G., & Costa, J. (2020). Network analysis for fraud detection in portuguese public procurement. Lecture Notes in Computer Science Intelligent Data Engineering and Automated Learning – IDEAL 2020, 390–401. https://doi.org/10.1007/978-3-030-62365-4_37 [19] CETA. (2020). Meta-learning in machine learning. https://ceta.umt.edu.pk/Blog/Meta-Learning-in- Machine-Learning.aspx [20] Chengrun, Y., Yuji, A., Dae, K., Won, & Madeleine, U. (2018). Oboe. OBOE: Collaborative Filtering for AutoML Initialization. 2nd Workshop on Meta-Learning at NeurIPS, Montréal, Canada. [21] Clark, T., Evans, A., Sammut, P., & Willans, J. (2015). Applied metamodelling: A foundation for language driven development (third edition). [22] Collins, A., Beel, J., & Tkaczyk, D. (2018). One-at-a-time: A meta-learning recommender-system for recommendation-algorithm selection on micro level. [23] Collins, A., Tkaczyk, D., & Beel, J. (2018). A novel approach to recommendation algorithm selection using meta-learning. AICS, 210–219. [24] Díaz, A. (2020). The four v’s of big data. https://opensistemas.com/en/the-four-vs-of-big-data/ [25] Domingos, P. (2018). The master algorithm: How the quest for the ultimate learning machine will remake our world. Basic Books, Inc. [26] Downey, L. (2021). Algorithmic/automated trading basic education. https://www.investopedia.com/terms/ a/algorithm.asp [27] Durfee, C. (2020). What is meta-learning in machine learning? https://www.aiproblog.com/index.php/ 2020/12/17/what-is-meta-learning-in-machine-learning/ [28] Edwards, S., Dorn, B., & Sanders, D. (2021). Problem solving and algorithms. http://sofia.cs.vt.edu/ cs1114-ebooklet/chapter4.html [29] Garner. (2017). Big data. https://www.gartner.com/en/information-technology/glossary/big-data [30] George, G., Haas, M. R., & Pentland, A. (2014). Big data and management. Academy of Management Journal,57(2), 321–326. https://doi.org/10.5465/amj.2014.4002 58
[31] Ghareh Mohammadi, F., Arabnia, H. R., & Amini, M. H. (2019). On parameter tuning in meta-learning for computer vision. 2019 International Conference on Computational Science and Computational Intelligence (CSCI), 300–305. https://doi.org/10.1109/CSCI49370.2019.00060 [32] Goh, G. B., Hodas, N. O., & Vishnu, A. (2017). Deep learning for computational chemistry. Journal of computational chemistry,38(16), 1291–1307. [33] Gupta, O., & Raskar, R. (2018). Distributed learning of deep neural network over multiple agents. [34] H. He, E. A. G., Y. Bai, & S. Li, A. (2008). Adaptive synthetic sampling approach for imbalanced learning. 2008 IEEE international joint conference on neural networks (IEEE world congress on computational intelligence), 1322–1328. [35] H2o. (n.d.). H2o documentation site. https://docs.h2o.ai/h2o/latest-stable/h2o-docs/index.html [36] He, X., Zhao, K., & Chu, X. (2019). Automl: A survey of the state-of-the-art. CoRR,abs/1908.00709. http://arxiv.org/abs/1908.00709 [37] Hochreiter, S., Bengio, Y., Frasconi, P., Schmidhuber, J. et al. (2001). Gradient flow in recurrent nets: The difficulty of learning long-term dependencies. [38] Jenkins, I., Gee, L., Knauss, A., Yin, H., & Schroeder, J. (2018). Accident scenario generation with recurrent neural networks, 3340–3345. https://doi.org/10.1109/ITSC.2018.8569661 [39] Kanf, E. (1985). Understanding and automating algorithm design. IEEE Transactions on Software Engineering,SE-11(11), 1361–1374. https://doi.org/10.1109/TSE.1985.231884 [40] Kempe, S. (2015). Pedro domingos’ on “five machine learning tribes”. https://www.dataversity.net/pedrodomingos-on-five-machine-learning-tribes/# [41] Kotsiantis, S. (2007). Supervised machine learning: A review of classification techniques. Informatica (Slovenia),31, 249–268. [42] Krawczyk, B., Minku, L., Gama, J., Stefanowski, J., & Wozniak, M. (2017). Ensemble learning for data stream analysis: A survey. Information Fusion,37, 132–156. https://doi.org/10.1016/j.inffus.2017.02.004 [43] Kwiatkowski, R. (2021). Gradient descent algorithm — a deep dive. https://towardsdatascience.com/ gradient-descent-algorithm-a-deep-dive-cf04e8115f21 [44] Li, D., Yang, Y., Song, Y.-Z., & Hospedales, T. M. (2017). Learning to generalize: Meta-learning for domain generalization. [45] Liashchynskyi, P. B., & Liashchynskyi, P. B. (2019). Grid search, random search, genetic algorithm: A big comparison for nas. ArXiv,abs/1912.06059. [46] Lu, J., Liu, A., Dong, F., Gu, F., Gama, J., & Zhang, G. (2018). Learning under concept drift: A review. IEEE Transactions on Knowledge and Data Engineering, 1–1. https://doi.org/10.1109/tkde.2018.2876857 59
[47] Luo, M., Chen, F., Cheng, P., Dong, Z., He, X., Feng, J., & Li, Z. (2020). Metaselector: Meta-learning for recommendation with user-level adaptive model selection. Proceedings of the web conference 2020 (pp. 2507–2513). Association for Computing Machinery. https://doi.org/10.1145/3366423.3379999 [48] Mahdavinejad, M. S., Rezvan, M., Barekatain, M., Adibi, P., Barnaghi, P., & Sheth, A. P. (2018). Machine learning for internet of things data analysis: A survey. Digital Communications and Networks,4(3), 161– 175. https://doi.org/https://doi.org/10.1016/j.dcan.2017.10.002 [49] Marr, B. (2021). What are the 4 vs of big data? https://bernardmarr.com/what-are-the-4-vs-of-big-data/ [50] Matijas, M., Suykens, J. A., & Krajcar, S. (2013). Load forecasting using a multivariate meta-learning system. Expert Systems with Applications,40(11), 4427–4437. https://doi.org/https://doi.org/10.1016/j. eswa.2013.01.047 [51] Monteiro, J., Ramos, D., Carneiro, D., Duarte, F., Fernandes, J., & Novais, P. (2021). Meta-learning and the new challenges of machine learning. International Journal of Intelligent Systems,36.https://doi.org/ 10.1002/int.22549 [52] Monteiro, J. P. S. (2020). A meta-learning approach for selecting machine learning algorithms. Universidade do Minho Dissertation. [53] N. V. Chawla, L. O. H., K. W. Bowyer, & Kegelmeyer, W. P. (2002). Smote: Synthetic minority oversampling technique. Journal of artificial intelligence research 16, 321–357. [54] Opitz, D., & Maclin, R. (1999). Popular ensemble methods: An empirical study. Journal of Artificial Intelligence Research,11, 169–198. https://doi.org/10.1613/jair.614 [55] Peffers, K., Tuunanen, T., Rothenberger, M. A., & Chatterjee, S. (2007). A design science research methodology for information systems research. Journal of Management Information Systems,24(3), 45– 77. https://doi.org/10.2753/MIS0742-1222240302 [56] Peteiro-Barral, D., & Guijarro-Berdiñas, B. (2012). A survey of methods for distributed machine learning. Progress in Artificial Intelligence,2, 1–11. [57] Polikar, R. (2006). Ensemble based systems in decision making. IEEE Circuits and Systems Magazine, 6(3), 21–45. https://doi.org/10.1109/mcas.2006.1688199 [58] Prabhu, R. (2022). Introduction to algorithms. https://www.geeksforgeeks.org/introduction-to-algorithms/ [59] R. A. Bauder, T. M. K., & Hasanin, T. (2018). Data sampling approaches with severely imbalancedbig data for medicare fraud detection. international conference on tools with artificial intelligence (ICTAI), 137–142. [60] Ravi, S., & Larochelle, H. (2016). Optimization as a model for few-shot learning. [61] Rice, J. R. (1976). The algorithm selection problem**this work was partially supported by the national science foundation through grant gp-32940x. this chapter was presented as the george e. forsythe memorial 60
lecture at the computer science conference, february 19, 1975, washington, d. c. In M. Rubinoff & M. C. Yovits (Eds.). Elsevier. https://doi.org/https://doi.org/10.1016/S0065-2458(08)60520-3 [62] Rokach, L. (2009). Ensemble-based classifiers. Artificial Intelligence Review,33(1-2), 1–39. https://doi. org/10.1007/s10462-009-9124-7 [63] Sutton, R. S., & Barto, A. G. (2018). Reinforcement learning: An introduction. MIT press. [64] Takimoglu, A. (2021). What is meta learning? techniques, benefits examples. https://research.aimultiple. com/meta-learning/ [65] Torrecilla, J. L., & Romo, J. (2018). Data learning from big data. Statistics & Probability Letters,136, 15– 19. [66] Trevino, L. K., & McCabe, D. (1994). Meta-learning about business ethics: Building honorable business school communities. Journal of Business Ethics,13(6), 405–416. [67] Triantafillou, E., Zhu, T., Dumoulin, V., Lamblin, P., Evci, U., Xu, K., Goroshin, R., Gelada, C., Swersky, K., Manzagol, P.-A., & Larochelle, H. (2020). Meta-dataset: A dataset of datasets for learning to learn from few examples. [68] Vanschoren, J. (2019). Meta-learning. Automated Machine Learning The Springer Series on Challenges in Machine Learning, 35–61. https://doi.org/10.1007/978-3-030-05318-5_2 [69] Webb, G. I., Hyde, R., Cao, H., Nguyen, H.-L., & Petitjean, F. (2015). Characterizing concept drift. CoRR, abs/1511.03816.http://arxiv.org/abs/1511.03816 [70] Weng, L. (2018). Meta-learning: Learning to learn fast. lilianweng.github.io/lil-log.https://lilianweng.github. io/lil-log/2018/11/30/meta-learning.html#optimization-based [71] Williams, C. O. I. (2020). Meta learning recommendation system for classification. https://scholar.afit.edu/ etd/3629 [72] Zhou, Z.-H. (2017). A brief introduction to weakly supervised learning. National Science Review,5(1), 44–53. https://doi.org/10.1093/nsr/nwx106 [73] Zliobaite, I., Pechenizkiy, M., & Gama, J. (2016). An overview of concept drift applications. Big Data Analysis: New Algorithms for a New Society. SBD,16, 91–114. https://doi.org/10.1007/978-3-319-26989- 4_4 61
This work has been supported by national funds through FCT – Fundação para a Ciência e Tecnologia through project EXPL/CCI-COM/0706/2021.