An empirical overview of the No Free Lunch Theorem and its effect on Real-World Machine Learning Classification
Abstract
A sizable amount of research has been done to improve the mechanisms for knowledge extraction such as machine learning classification or regression. Quite unintuitively, the no free lunch (NFL) theorem states that all optimization problem strategies perform equally well when averaged over all possible problems. This fact seems to clash with the effort put forth toward better algorithms. This letter explores empirically the effect of the NFL theorem on some popular machine learning classification techniques over real-world data sets.
Full text
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof LETTER Communicated by David Wolpert An Empirical Overview of the No Free Lunch Theorem and Its Effect on Real-World Machine Learning Classification David G´ omez [email protected] Alfonso Rojas [email protected] Telematics Engineering Department, Polytechnical University of Catalonia, Barcelona 08034, Spain A sizable amount of research has been done to improve the mechanisms for knowledge extraction such as machine learning classification or regression. Quite unintuitively, the no free lunch (NFL) theorem states that all optimization problem strategies perform equally well when averaged over all possible problems. This fact seems to clash with the effort put forth toward better algorithms. This letter explores empirically the effect of the NFL theorem on some popular machine learning classification techniques over real-world data sets. 1 Introduction In the relatively recent history of machine learning, one important goal has always been to provide the maximum predictive power on a particular data domain.1Since this domain is usually fixed in the form of a data set, the potential for prediction improvement lies in either data preprocessing or more sophisticated algorithms. The former is a customized procedure tailored to the specific needs of each data set, so to tackle general problems, a large amount of research has been done to obtain better algorithms. Unfortunately, an objective evaluation of machine learning classifiers is not as straightforward as it could be. In 1996, Wolpert (1996a, 1996b) wrote about what came to be known as the no free lunch theorem, with another clarification oriented toward searching algorithms on (Wolpert, 2013). In a machine learning context, the NFL theorem implies that all learning algorithms perform equally well when averaged over all possible data sets. This nonintuitive idea meant that looking for a general, highly predictive algorithm is not feasible. It is also surprising, since it is well known in empirical research that some algorithms perform consistently much better than others. 1Other possible goals include simplicity, interpretability, or accountability. Neural Computation 28, 1–13 (2016) c Massachusetts Institute of Technology doi:10.1162/NECO_a_00793 "This paper is a manuscript version of a paper submitted to and accepted for publication in Neural Computation"
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof 2D.G ´ omez and A. Rojas This letter’s overview was compiled from results gathered on the development of a custom machine learning library for a software project of one of the authors (G´ omez, 2014). Section II describes the relevant methodology used in the original study: the implemented algorithms, the data sets that were used, and other important details. From all the results, figures, and tables, section 3 focuses and comments on those relevant for our discussion on the NFL. Finally, we summarize our findings in section 4 and compare them to other similar research. 2 Methodology During our machine learning library development, we implemented and tested eight well-known algorithms, not including other custom methods beyond the scope of this review. The tests were performed by averaging 20 executions of each individual algorithm on every one of the chosen data sets, using a holdout model validation scheme with two-thirds of the data for training and the remaining third for testing. The reported results include the average accuracy result and the 95% confidence interval to see its variance. Besides the different classifiers, the original study also includes results aboutexecutiontime,validationschemebehavior,andfeatureselection.The focus in this letter, though, is on the algorithm and data set performance, complemented with some results from other areas when necessary. (For more information, see G´ omez, 2014). Since the study was quite extensive, the training hyperparameters were fixed to the default values specified in Table 1. Time and hardware support were in limited supply, so a full-featured cross-validation hyperparameter tuning procedure was not possible to do for many experiments in the report. Nevertheless, the goal was not to obtain the maximum accuracy in each execution but to get an approximation in order to compare the different models, so the conclusions can still be valid if highly parametric classifiers such as neural networks are carefully considered. The objective of this study is to use the results from that report to observe the effect of the assumptions and structural properties of both data sets and algorithms and discuss which underlying mechanisms exist to cause those effects. For the purposes of testing the correctness and efficiency of the library, six data sets were used as a benchmark, chosen to represent a wide enough spectrum of complexity, size, and domain (medicine, finance, social science, visual recognition). All of them are available at the UCI machine learning repository (Lichman, 2013) and are described in Table 2. The reason to develop a new machine learning library instead of reusing another one was twofold. On the one hand, existing Java libraries did not have the necessary technical or license requirements to use in our project, but most important, by writing the code from scratch, we were able to learn
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof Theorem on Real-World Classification 3 Table 1: Classifiers Used and Default Parameters Used. Classifier Default Parameters Naive Bayes (John & Langley, 1995) C4.5 decision trees (Quinlan, 1993) Prepruning Neural networks (Rumelhart, Hinton, & Williams, 1988) One hidden layer (#attributes + #classes)/2 nodes Learning rate =0.3 Momentum =0.2 500 epochs k-nearest neighbors (Altman, 1992) k=3 Euclidean distance Logistic regression (Cox, 1958) Random C4.5 forest (Breiman, 2001) 20 trees AdaBoost.M1 (Freund & Schapire, 1996) Using decision stumps Stacking (Wolpert, 1992) using: Naive Bayes Random C4.5 forest Neural network 3-NN Combiner: logistic regression and control their inner workings in more detail. Knowing more about these algorithms makes it possible to adjust, optimize, and use them in a more effective way for our specific purposes. In order to evaluate these classifiers’ implementation, the machine learning suite Weka (Hall et al., 2009) was used to compare the results and determine whether the accuracy of our models is similar. The assessment was positive, and it was concluded that all the algorithms work correctly, all of them having similar accuracy results to Weka’s implementation with the small exception of decision trees. In this last case, the design choice to implement prepruning instead of postpruning makes our decision trees slightly less accurate—a few percentage points at most. 3 Results The average accuracy over all six data sets is pictured in Figure 1. These results are mostly consistent with previous research, but according to the NFL theorem on a sufficiently large pool of data sets, they should be similarly accurate. The most sensible explanation is that the classification problems in the real world usually belong to a particular subgroup of these possible, theoretical data sets. Some common structural properties or assumptions are general and applicable to all kinds of sets, like Occam’s razor or the independent and
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof 4D.G ´ omez and A. Rojas Table 2: Data Sets Used and Relevant Notes about Them. Data Set Notes Audiology Very imbalanced classes (see Figure 5) Many imbalanced features Large number of classes (24) (Relatively) large number of features (69) All features nominal Large amount of missing values Column Slightly imbalanced classes Lownumberoffeatures(6) Low number of classes (3) All features nominal No missing values Breast cancer Slightly imbalanced classes Binary class All features nominal Some missing values Difficult to classifya Multiple features Balanced classes (see Figure 5) (Fourier) (Relatively) large set (2000 instances) All features numeric No missing values Significant difference in difficulty between classes German credit Slightly imbalanced classes Binary class Mix of nominal (13) and numeric (7) features No missing values Difficult to classifyb Nursery Large set (12,960 instances) Mix of balanced (3) and imbalanced (2) classes No missing values All features nominal All possible instance permutations available (census) Easy to classifyc aResults from other research on the breast cancer set are available at http://www.fizyka.umk.pl/kis/projects/datasets.html#Ljubljana. We define difficulty as the inability to build a model that improves beyond the baseline accuracy by any significant amount, as best described by the κstatistic (Carletta, 1996). bResults from other research on German credit set are available at Huang, Chen, and Wang (2006). cResults from other research on nursery set are available at Kumar, Nitin, and Chauhan (2012). identical distribution of the samples. From all the data-dependent structural properties in the data sets, the most critical assumptions we have found in our analysis are two: determinism and the Pareto principle.
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof Theorem on Real-World Classification 5 Figure 1: Average model accuracy over all six data sets. 3.1 Determinism. Determinism implies that the same input values should belong to the same class. Causality and determinism are the basis of science, even if noise is usually an unavoidable and unfortunate reality in practice. In this case, noise-resistant algorithms such as naive Bayes tend to work better than, for instance, decision trees that are prone to overfit the model unless properly pruned. The comparison between the results of a fully deterministic data set (nursery, due to all possible instances being accounted for) and a noisy one (credit rating, probably due to hidden variables) can tell us more. Observing the decision tree’s behavior, we see that it has below-baseline performance on the credit set but performs much better (compared to other algorithms) on the nursery set (center right and bottom right in figure 2, respectively). By performing feature selection in the former, the next section will show how the noise of useless attributes is filtered out and the result improves beyond the baseline accuracy, to a similar level to the rest of algorithms. Many of the drawbacks posed by decision trees are reduced by using them in ensemble methods, such as bagging or random forests. These aggregations are able to cancel some of the noise and offer consistent improvement over individual trees, as pictured in Figure 3. 3.2 Pareto Principle. Most information in a data set is often contained in only a few features. Of course, features are initially chosen by the data collector, and many times they do not know which ones will be important; that is why they might use machine learning in the first place. That means some attributes tend to be useless and add noise without providing much valuable information in return, disrupting the performance
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof 6D.G ´ omez and A. Rojas Figure 2: Average model accuracy for each tested data set (left) along with the average Cohen’s kappa coefficient (right) to provide a more realistic outlook on the real helpfulness of the models. of some classifiers, like decision trees, if they are not filtered out. Figure 4, for instance, shows how decision trees are specially sensitive to this problem and how the model average accuracy is considerably improved by filtering out the useless features.
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof Theorem on Real-World Classification 7 Figure 3: Average accuracy comparison between single decision trees and random forest, for different holdout percentages, for the breast cancer data set. In this case, forests reveal approximately a 4% improvement over single trees. Figure 4: Breast cancer set accuracy per classifier, with different feature selection methods. Decision trees in particular perform notably better after CFS feature selection (Hall, 2000), while the kNN classifier, a local approximator, is heavily penalized. Also related to this principle is the fact that many natural data sets have intrinsically imbalanced classes. We can see an example of that in the audiology data set class distribution in Figure 5 (left), where many classes are barely available. Even when balance exists, it is many times artificially implemented due to a lack of previous knowledge (see the multiple features set class balance on the right in Figure 5, where the same number of samples
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof 8D.G ´ omez and A. Rojas Figure 5: Audiology (left) and multiple features (right) data set class distributions. Highly imbalanced sets are usually more difficult to learn properly, and the overall accuracy estimation might not be representative of all classes. Figure 6: Training error for AdaBoost.M1 on the multiple features data set per digit. Excluding the first few points, the error rate is always below the baseline error (10%), yet when all these internal classifiers are combined, the average error is around 25%. was chosen for each class). In these cases the most conservative action is assuming a noninformative prior (in Bayesian terms) and deciding that all classes are equally probable. In the case of the multiple features set, AdaBoost.M1 exhibits clearly this effect (see Figure 6). This algorithm starts by training one-versus-all classifiers for each class (i.e., “Does this input represent digit d?”), building training sets with a 10%/90% class composition in this particular data set.
NECO_a_00793-Gomez neco.cls November 13, 2015 14:27 Uncorrected Proof Theorem on Real-World Classification 9 Figure 7: SVM models (with polynomial and RBF kernels) compared to the rest of the models introduced in Figure 2. The red interval represents the range (minimum and maximum) of the accuracies of the eight other models. In four out of the six sets, kernel machines surpass the maximum obtained by these previous classification algorithms. The separate evaluation of these inner models can offer misleadingly high accuracies (over 90%), yet combining these classifiers returns an overall model with an accuracy around 75%. This is expected. Since the goal is to minimize the error, there is always a biased prior toward the most populated class, so the inner models in an ensemble are not always representative of the original problem. This fact might determine which algorithm to use, since some of them (like kNN or SVM; Akbani, Kwek, & Japkowicz, 2004) are often significantly impaired by imbalanced classes. Despite this last assertion, additional experiments we performed to test the capabilities of kernel machines (SVM in particular) show that even in imbalanced sets, these algorithms can outperform other popular methods. Figure 7 shows, for example, how an SVM on the audiology set can offer an increase of 10% over the best algorithm we tried in the original study. 3.3 Abstraction Layers. Beyond the traits we are able to discern in these admittedly simple (yet real) data sets, other aspects more relevant for current applications and research are worth discussing as well. Many state-of-the-art techniques in machine learning for complex data sets often focus on deep learning. The idea behind this philosophy is to break down complex problems in several abstraction layers to simplify the learning process; its adoption in recent years is widespread and well documented in a great variety of successful projects in companies such as Apple and Google (Vinyals, Toshev, Bengio, & Erhan, 2014).