MetaCost: a general method for making classifiers cost-sensitive

Pedro M. Domingos

article1999KDD1,651 citations

Presents MetaCost, a general wrapper method that converts any standard, error-minimizing classification algorithm into a cost-sensitive classifier by relabeling training data using ensemble probability estimates and arbitrary cost matrices.

Listen

Real-world data mining and decision-making problems rarely involve equal error costs; for instance, failing to detect a critical system failure or missing a high-value customer incurs far greater losses than generating a false alarm. Despite this reality, most standard classification algorithms are designed solely to minimize error counts, implicitly treating all mistakes as equally costly. Existing workarounds, such as manually altering class frequencies in training data (stratification), suffer from severe constraints: they often distort underlying data distributions, discard valuable training examples or increase compute time, and fail to accommodate complex multiclass cost structures.

The article demonstrates and evaluates MetaCost, a general method that converts any standard classification algorithm into a cost-sensitive system without requiring internal modifications to the base algorithm.

MetaCost operates as an external wrapper. It generates multiple bootstrap resamples of the training data, trains the chosen classifier on each resample, and pools their votes to estimate the probability distribution across classes for every training example. Using these estimated probabilities alongside a specified cost matrix, it recalculates the expected cost (risk) for each decision and relabels every training example with its optimal, cost-minimizing class. Finally, it trains a single final model on the relabeled dataset. The authors evaluated MetaCost using 28 benchmark databases (15 multiclass and 12 two-class problems) alongside a large NASA space shuttle sensor dataset, using decision rule induction as the base classifier.

Empirical testing showed that MetaCost consistently achieved superior cost reductions compared to standard classifiers and traditional stratification techniques. In multiclass evaluations, MetaCost reduced costs more effectively than undersampling and oversampling in all tested datasets under realistic cost conditions, outperforming standard classification with over 99% statistical confidence and achieving cost reductions approximately twice as large as undersampling. In two-class benchmarks, MetaCost maintained lower overall costs across various cost ratios. Ablation analysis confirmed that while generating multiple models is essential to compute reliable probabilities, as few as 10 to 20 resamples are sufficient for peak performance. On the large shuttle dataset (58,000 examples), MetaCost scaled efficiently; using small resamples alongside noise-filtering effects, it lowered costs by over an order of magnitude while running more than ten times faster than the base classifier on noisy data.

These findings indicate that organizations can directly minimize financial and operational risk without abandoning their existing, well-tested data mining algorithms. Because MetaCost outputs a single, clean model rather than a complex black-box ensemble, it preserves rule comprehensibility and auditability. Furthermore, if the operational cost matrix changes, organizations only need to re-run the final relabeling and training step rather than recomputing the entire ensemble, saving substantial computational time and workflow disruption.

Decision-makers should consider adopting wrapper-based relabeling like MetaCost when deploying predictive models in high-stakes environments where error consequences are asymmetric. When scaling to larger datasets, teams can minimize compute costs by keeping the resample count near 10 and utilizing sub-sampled training partitions, or by running the independent resamples in parallel.

Confidence in these findings is high for rule-based and tree-based decision models across standard tabular benchmarks. However, the evaluation focused primarily on one underlying rule-learning algorithm, and the method relies on model instability (such as that found in decision trees) to generate diverse votes. Leaders should exercise caution before applying the standard implementation to inherently stable algorithms (such as naive Bayes or nearest-neighbor classifiers) without adapting the sampling approach to use feature subsets instead of data subsets.

Domingos (1999).pdf
Cover for MetaCost: a general method for making classifiers cost-sensitive

Abstract

Research in machine learning, statistics and related fields has produced a wide variety of algorithms for classification. However, most of these algorithms assume that all errors have the same cost, which is seldom the case in KDD problems. Individually making each classification learner cost-sensitive is laborious, and often non-trivial. In this paper we propose a principled method for making an arbitrary classifier cost-sensitive by wrapping a cost-minimizing procedure around it. This procedure, called MetaCost, treats the underlying classifier as a black box, requiring no knowledge of its functioning or change to it. Unlike stratification, MetaCost is applicable to any number of classes and to arbitrary cost matrices. Empirical trials on a large suite of benchmark databases show that MetaCost almost always produces large cost reductions compared to the cost-blind classifier used (C4.5RULES) and to two forms of stratification. Further tests identify the key components of MetaCost and those that can be varied without substantial loss. Experiments on a larger database indicate that MetaCost scales well.

Table of Contents

  • 1 Introduction
  • 2 The MetaCost Algorithm
  • 3 Empirical Evaluation
  • 3.1 Multiclass Problems
  • 3.2 Two-Class Problems
  • 3.3 Lesion Studies
  • 3.4 Scaling Up
  • 4 Related Work
  • 5 Future Work
  • 6 Conclusion
  • Acknowledgements
  • References

Knowls

  1. Knowl 1 — The MetaCost Framework for Cost-Sensitive Classification

    model/method

    MetaCost is a meta-learning method designed to convert any arbitrary error-based (cost-blind) classification algorithm into a cost-sensitive classifier without altering the underlying learning algorithm or inspecting its internal representation.

    The core intuition of MetaCost is that the optimal decision boundaries under non-uniform misclassification costs differ from zero-one loss boundaries. If training examples are relabeled according to the Bayes optimal prediction under a given cost matrix, a standard cost-blind learner trained on this relabeled dataset will implicitly learn the cost-minimizing decision boundaries.

    MetaCost operates in four stages:

    1. Ensemble Generation: It creates mm bootstrap resamples S1,…,SmS_1, \dots, S_m of the training dataset SS and applies the base classifier LL to each to learn models M1,…,MmM_1, \dots, M_m.
    2. Conditional Class Probability Estimation: For each training example x∈Sx \in S, MetaCost estimates the conditional probability distribution P(j∣x)P(j|x) across all candidate classes jj by aggregating predictions (either fractional class votes or predicted class probabilities) across the ensemble models (typically excluding models trained on subsets containing xx).
    3. Bayes Optimal Relabeling: Using the estimated probabilities P(j∣x)P(j|x) and the cost matrix CC, MetaCost computes the expected conditional risk for each class and relabels xx with the class that minimizes this risk.
    4. Final Model Induction: The original cost-blind learner LL is trained on the relabeled training dataset to generate a single, cost-sensitive classification model.
  2. Knowl 2 — Conditional Risk and Bayes Optimal Class Relabeling

    equation

    Let XX denote the instance space and let j∈{1,…,K}j \in \{1, \dots, K\} index the possible target classes. Let CC be an arbitrary K×KK \times K cost matrix where C(i,j)C(i, j) represents the cost of predicting class ii when the true class is jj. Given an example x∈Xx \in X and conditional class probabilities P(j∣x)P(j|x), the conditional risk R(i∣x)R(i|x) of predicting class ii is defined as:

    R(i∣x)=∑j=1KP(j∣x)C(i,j)R(i|x) = \sum_{j=1}^{K} P(j|x) C(i, j)

    The Bayes optimal prediction for xx is the class i∗i^* that minimizes the expected conditional risk:

    i∗(x)=arg⁡min⁡iR(i∣x)=arg⁡min⁡i∑j=1KP(j∣x)C(i,j)i^*(x) = \arg\min_{i} R(i|x) = \arg\min_{i} \sum_{j=1}^{K} P(j|x) C(i, j)

    In the MetaCost procedure, every pre-classified training example x∈Sx \in S has its training label replaced by i∗(x)i^*(x) using estimated conditional probabilities P^(j∣x)\hat{P}(j|x) prior to training the final classifier.

  3. Knowl 3 — The MetaCost Algorithm

    algorithm

    The MetaCost algorithm takes a training dataset, an arbitrary classification learning algorithm, a cost matrix, and ensemble hyperparameters, and returns a single cost-sensitive model.

    Input:
      SS: training set of examples
      LL: classification learning algorithm
      CC: cost matrix where C(i,j)C(i, j) is the cost of predicting class ii when true class is jj
      mm: number of resamples to generate
      nn: number of examples in each resample
      pp: boolean flag, True if LL produces class probabilities, False otherwise
      qq: boolean flag, True if all resamples are used for each example, False to use only out-of-bag resamples
    Output:
      MM: cost-sensitive classification model
    for i=1i = 1 to mm do
      Let SiS_i be a resample of SS with nn examples drawn with replacement
      Let Mi=L(Si)M_i = L(S_i) (model produced by applying LL to SiS_i)
    end for
    for each example xx in SS do
      for each class jj do
        if qq is True then
          Let Mx={M1,…,Mm}\mathcal{M}_x = \{M_1, \dots, M_m\}
        else
          Let Mx={Mi∣x∉Si}\mathcal{M}_x = \{M_i \mid x \notin S_i\}
        end if
        
        if pp is True then
          P(j∣x)=1∣Mx∣∑Mi∈MxP(j∣x,Mi)P(j|x) = \frac{1}{|\mathcal{M}_x|} \sum_{M_i \in \mathcal{M}_x} P(j|x, M_i)
        else
          P(j∣x)=1∣Mx∣∑Mi∈MxI(Mi(x)=j)P(j|x) = \frac{1}{|\mathcal{M}_x|} \sum_{M_i \in \mathcal{M}_x} I(M_i(x) = j)
        end if
      end for
      
      Let xx's relabeled class = arg⁡min⁡i∑jP(j∣x)C(i,j)\arg\min_i \sum_j P(j|x) C(i, j)
    end for
    Let S′S' be the dataset SS with all instance labels replaced by their relabeled classes
    Let M=L(S′)M = L(S')
    return MM
  4. Knowl 4 — Experimental Evaluation Setup for Cost-Sensitive Classifiers

    experimental setup

    The empirical performance of MetaCost was evaluated against cost-blind learning and two variants of stratification using 28 benchmark datasets from the UCI repository (15 multiclass datasets, 12 two-class datasets, and the large Shuttle database).

    • Base Learner: C4.5 decision tree learner coupled with the C4.5RULES post-processor (abbreviated C4.5R).
    • Data Partitioning: 20 independent runs per dataset, using a random 2/32/3 split for training and 1/31/3 for testing.
    • Baselines:
      1. Cost-blind C4.5R.
      2. Stratification by Undersampling: Re-weights class marginal distribution P′(j)=C(j)P(j)∑kC(k)P(k)P'(j) = \frac{C(j)P(j)}{\sum_k C(k)P(k)}, where C(j)=∑iC(i,j)C(j) = \sum_i C(i, j). Retains all examples of the highest P′(j)P'(j) class and samples a fraction P′(i)/P′(j)P'(i)/P'(j) of all other classes.
      3. Stratification by Oversampling: Retains all examples of the lowest P′(j)P'(j) class and duplicates examples of each other class ii approximately P′(i)/P′(j)P'(i)/P'(j) times.
    • Cost Models:
      • Multiclass Fixed-Interval: C(i,i)∼U[0,1000]C(i, i) \sim U[0, 1000] and C(i,j)∼U[0,10000]C(i, j) \sim U[0, 10000] for i≠ji \neq j.
      • Multiclass Class-Probability-Dependent: C(i,i)∼U[0,1000]C(i, i) \sim U[0, 1000] and C(i,j)∼U[0,2000P(i)/P(j)]C(i, j) \sim U[0, 2000 P(i)/P(j)] for i≠ji \neq j, reflecting higher misclassification penalties for rare classes.
      • Two-Class: C(1,1)=C(2,2)=0C(1, 1) = C(2, 2) = 0, C(1,2)=1000C(1, 2) = 1000, and C(2,1)=1000rC(2, 1) = 1000 r where r∈{2,5,10}r \in \{2, 5, 10\} (class 1 is the minority class, class 2 is the majority class).
    • Default MetaCost Settings: m=50m = 50, n=∣S∣n = |S|, p=Truep = \text{True} (using C4.5R rule probabilities), q=Falseq = \text{False} (out-of-bag probability estimation).
  5. Knowl 5 — Multiclass Cost Reduction Performance on Benchmark Datasets

    data/table

    The table compares the average test cost and standard deviation over 20 runs for C4.5R, undersampling stratification, oversampling stratification, and MetaCost across 15 multiclass UCI benchmark datasets under both fixed-interval and class-probability-dependent cost matrices.

    Database Costs from fixed interval Costs from class-prob.-dependent interval
    C4.5R Underspl Overspl MetaCost C4.5R Underspl Overspl MetaCost
    Annealing 1061±231061 \pm 23 1076±181076 \pm 18 989±20989 \pm 20 984±24984 \pm 24 1258±891258 \pm 89 711±44711 \pm 44 1027±531027 \pm 53 46±346 \pm 3
    Audiology 1842±901842 \pm 90 2008±812008 \pm 81 1569±831569 \pm 83 1769±781769 \pm 78 2264±1952264 \pm 195 609±124609 \pm 124 1833±1451833 \pm 145 17±1017 \pm 10
    Glass 1986±811986 \pm 81 1856±1021856 \pm 102 1786±901786 \pm 90 1217±641217 \pm 64 1169±921169 \pm 92 548±36548 \pm 36 1052±861052 \pm 86 221±10221 \pm 10
    Iris 652±30652 \pm 30 618±26618 \pm 26 641±25641 \pm 25 513±16513 \pm 16 470±22470 \pm 22 454±18454 \pm 18 469±20469 \pm 20 345±20345 \pm 20
    LED 2016±922016 \pm 92 2181±782181 \pm 78 1897±811897 \pm 81 1484±671484 \pm 67 835±44835 \pm 44 814±52814 \pm 52 727±21727 \pm 21 393±16393 \pm 16
    Lenses 1624±1321624 \pm 132 1687±1591687 \pm 159 1596±1671596 \pm 167 1515±1101515 \pm 110 1171±2641171 \pm 264 910±218910 \pm 218 972±115972 \pm 115 192±18192 \pm 18
    Lung cancer 2363±2612363 \pm 261 1714±1481714 \pm 148 1957±2631957 \pm 263 1577±1441577 \pm 144 969±135969 \pm 135 624±74624 \pm 74 1013±1461013 \pm 146 370±39370 \pm 39
    Lymphogr. 1055±501055 \pm 50 1000±571000 \pm 57 970±57970 \pm 57 721±33721 \pm 33 1118±1101118 \pm 110 489±86489 \pm 86 1054±1111054 \pm 111 60±560 \pm 5
    Post-oper. 1239±1521239 \pm 152 686±31686 \pm 31 1614±911614 \pm 91 666±31666 \pm 31 2322±2302322 \pm 230 841±112841 \pm 112 2016±1512016 \pm 151 83±983 \pm 9
    Pr. tumor 3475±883475 \pm 88 3478±1233478 \pm 123 3759±983759 \pm 98 3446±873446 \pm 87 3193±3383193 \pm 338 936±117936 \pm 117 1691±1171691 \pm 117 17±717 \pm 7
    Solar flare 1602±881602 \pm 88 1430±941430 \pm 94 1425±791425 \pm 79 875±43875 \pm 43 1342±981342 \pm 98 542±66542 \pm 66 996±70996 \pm 70 133±7133 \pm 7
    Soybean 716±35716 \pm 35 718±44718 \pm 44 739±46739 \pm 46 873±91873 \pm 91 682±33682 \pm 33 632±37632 \pm 37 685±35685 \pm 35 283±26283 \pm 26
    Splice 659±12659 \pm 12 602±13602 \pm 13 715±10715 \pm 10 556±11556 \pm 11 412±12412 \pm 12 424±9424 \pm 9 419±11419 \pm 11 342±4342 \pm 4
    Wine 685±24685 \pm 24 647±33647 \pm 33 670±29670 \pm 29 558±25558 \pm 25 461±18461 \pm 18 475±13475 \pm 13 455±14455 \pm 14 264±13264 \pm 13
    Zoology 1148±1031148 \pm 103 1153±1051153 \pm 105 857±49857 \pm 49 873±66873 \pm 66 624±85624 \pm 85 650±108650 \pm 108 540±62540 \pm 62 169±14169 \pm 14

    Under the fixed-interval cost model, MetaCost achieves lower cost than C4.5R and undersampling on 14 of 15 datasets, and lower cost than oversampling on 12 of 15 datasets. Under the class-probability-dependent cost model, MetaCost achieves the lowest cost across all 15 datasets, yielding an average cost reduction roughly twice as large as undersampling and five times as large as oversampling. In both settings, the performance difference favoring MetaCost is statistically significant with confidence exceeding 99%99\% under sign and Wilcoxon tests.

  6. Knowl 6 — Two-Class Cost Reduction Across Variable Cost Ratios

    data/table

    The table reports average costs and standard deviations over 20 runs across 12 two-class UCI datasets for cost ratios r∈{2,5,10}r \in \{2, 5, 10\} (where misclassifying the minority class costs 1000r1000r and misclassifying the majority class costs 10001000).

    Cost ratio Database C4.5R Underspl Overspl MetaCost
    2 Breast cancer 505±25505 \pm 25 509±14509 \pm 14 577±23577 \pm 23 511±20511 \pm 20
    Credit 239±11239 \pm 11 218±8218 \pm 8 247±10247 \pm 10 187±7187 \pm 7
    Diabetes 404±12404 \pm 12 386±10386 \pm 10 395±8395 \pm 8 335±7335 \pm 7
    Echocardiogram 590±23590 \pm 23 514±21514 \pm 21 549±22549 \pm 22 497±22497 \pm 22
    Heart disease 323±15323 \pm 15 328±11328 \pm 11 350±15350 \pm 15 304±10304 \pm 10
    Hepatitis 346±24346 \pm 24 327±21327 \pm 21 337±21337 \pm 21 326±25326 \pm 25
    Horse colic 244±10244 \pm 10 273±14273 \pm 14 275±13275 \pm 13 244±8244 \pm 8
    Labor 226±35226 \pm 35 308±33308 \pm 33 245±35245 \pm 35 247±24247 \pm 24
    Liver disease 593±24593 \pm 24 540±15540 \pm 15 503±18503 \pm 18 548±16548 \pm 16
    Promoters 340±29340 \pm 29 306±30306 \pm 30 316±35316 \pm 35 296±16296 \pm 16
    Sonar 484±25484 \pm 25 442±21442 \pm 21 472±33472 \pm 33 439±21439 \pm 21
    Voting 65±765 \pm 7 67±567 \pm 5 71±671 \pm 6 59±459 \pm 4
    5 Breast cancer 1078±701078 \pm 70 821±37821 \pm 37 1130±571130 \pm 57 688±21688 \pm 21
    Credit 491±28491 \pm 28 306±15306 \pm 15 557±24557 \pm 24 282±11282 \pm 11
    Diabetes 824±34824 \pm 34 556±20556 \pm 20 727±21727 \pm 21 480±13480 \pm 13
    Echocardiogram 1244±651244 \pm 65 727±43727 \pm 43 1068±671068 \pm 67 688±23688 \pm 23
    Heart disease 632±43632 \pm 43 466±23466 \pm 23 700±37700 \pm 37 416±22416 \pm 22
    Hepatitis 741±60741 \pm 60 517±47517 \pm 47 628±54628 \pm 54 503±40503 \pm 40
    Horse colic 520±24520 \pm 24 510±31510 \pm 31 531±31531 \pm 31 415±24415 \pm 24
    Labor 463±89463 \pm 89 579±48579 \pm 48 484±54484 \pm 54 539±35539 \pm 35
    Liver disease 1268±751268 \pm 75 625±22625 \pm 22 1054±461054 \pm 46 616±13616 \pm 13
    Promoters 743±69743 \pm 69 449±40449 \pm 40 829±102829 \pm 102 409±32409 \pm 32
    Sonar 1019±661019 \pm 66 654±49654 \pm 49 1001±571001 \pm 57 517±23517 \pm 23
    Voting 123±18123 \pm 18 89±989 \pm 9 106±13106 \pm 13 76±676 \pm 6
    10 Breast cancer 2034±1482034 \pm 148 792±37792 \pm 37 2039±982039 \pm 98 711±16711 \pm 16
    Credit 911±57911 \pm 57 481±29481 \pm 29 1039±531039 \pm 53 396±13396 \pm 13
    Diabetes 1524±721524 \pm 72 684±24684 \pm 24 1326±631326 \pm 63 549±15549 \pm 15
    Echocardiogram 2335±1372335 \pm 137 856±60856 \pm 60 1945±1511945 \pm 151 668±16668 \pm 16
    Heart disease 1147±901147 \pm 90 567±40567 \pm 40 1209±831209 \pm 83 576±17576 \pm 17
    Hepatitis 1400±1231400 \pm 123 770±62770 \pm 62 1190±1101190 \pm 110 721±51721 \pm 51
    Horse colic 979±50979 \pm 50 638±17638 \pm 17 946±57946 \pm 57 617±16617 \pm 16
    Labor 858±179858 \pm 179 671±22671 \pm 22 858±95858 \pm 95 674±34674 \pm 34
    Liver disease 2393±1622393 \pm 162 671±33671 \pm 33 1883±1031883 \pm 103 580±13580 \pm 13
    Promoters 1414±1381414 \pm 138 436±12436 \pm 12 1634±1731634 \pm 173 506±52506 \pm 52
    Sonar 1910±1381910 \pm 138 740±69740 \pm 69 1799±1321799 \pm 132 498±20498 \pm 20
    Voting 220±37220 \pm 37 132±16132 \pm 16 168±27168 \pm 27 118±8118 \pm 8

    Even in two-class problems where stratification can be applied without approximation, MetaCost outperforms C4.5R, undersampling, and oversampling across almost all datasets and cost ratios. MetaCost results are lower than each alternative baseline with statistical confidence exceeding 99%99\% under sign and Wilcoxon tests across all ratios (except sign test vs undersampling at r=10r=10, where confidence is 98%98\%).

  7. Knowl 7 — Ablation and Lesion Analysis of MetaCost Components

    data/table

    To evaluate the sensitivity of MetaCost to its constituent components, several variants were evaluated on the two-class databases across cost ratios r∈{2,5,10}r \in \{2, 5, 10\}:

    • m=20m=20 and m=10m=10: Reducing resample count from m=50m=50.
    • C4 Probs: Relabeling based on class probabilities from a single run of C4.5R on the complete training data rather than using an ensemble.
    • 0-1 Votes: Ignoring base learner class probabilities and estimating probabilities strictly by counting binary predictions across models (p=Falsep=\text{False}).
    • All Ms: Relabeling each example using all models rather than strictly out-of-bag models (q=Trueq=\text{True}).
    Cost ratio Database m=20m=20 m=10m=10 C4 Probs 0-1 Votes All Ms
    2 Breast cancer 514±18514 \pm 18 506±25506 \pm 25 498±22498 \pm 22 495±19495 \pm 19 519±19519 \pm 19
    Credit 188±7188 \pm 7 196±6196 \pm 6 227±9227 \pm 9 202±8202 \pm 8 193±7193 \pm 7
    Diabetes 343±7343 \pm 7 348±8348 \pm 8 390±9390 \pm 9 357±8357 \pm 8 355±8355 \pm 8
    Echocardiogram 477±20477 \pm 20 460±20460 \pm 20 542±20542 \pm 20 507±26507 \pm 26 547±25547 \pm 25
    Heart disease 292±12292 \pm 12 306±10306 \pm 10 320±14320 \pm 14 308±12308 \pm 12 300±11300 \pm 11
    Hepatitis 330±24330 \pm 24 333±25333 \pm 25 337±22337 \pm 22 317±22317 \pm 22 336±21336 \pm 21
    Horse colic 247±9247 \pm 9 258±10258 \pm 10 255±10255 \pm 10 237±8237 \pm 8 255±10255 \pm 10
    Labor 213±29213 \pm 29 300±35300 \pm 35 242±33242 \pm 33 266±29266 \pm 29 208±26208 \pm 26
    Liver disease 535±11535 \pm 11 553±17553 \pm 17 566±16566 \pm 16 537±13537 \pm 13 546±19546 \pm 19
    Promoters 310±25310 \pm 25 337±20337 \pm 20 327±45327 \pm 45 357±31357 \pm 31 330±30330 \pm 30
    Sonar 436±24436 \pm 24 449±26449 \pm 26 451±25451 \pm 25 469±18469 \pm 18 429±18429 \pm 18
    Voting 58±558 \pm 5 65±465 \pm 4 64±664 \pm 6 59±459 \pm 4 60±560 \pm 5
    5 Breast cancer 712±24712 \pm 24 732±27732 \pm 27 823±45823 \pm 45 809±41809 \pm 41 719±25719 \pm 25
    Credit 277±12277 \pm 12 289±12289 \pm 12 331±20331 \pm 20 287±14287 \pm 14 286±11286 \pm 11
    Diabetes 477±10477 \pm 10 511±13511 \pm 13 600±27600 \pm 27 490±11490 \pm 11 499±11499 \pm 11
    Echocardiogram 699±31699 \pm 31 684±32684 \pm 32 876±55876 \pm 55 791±47791 \pm 47 730±32730 \pm 32
    Heart disease 418±20418 \pm 20 442±21442 \pm 21 514±42514 \pm 42 404±20404 \pm 20 431±24431 \pm 24
    Hepatitis 546±29546 \pm 29 551±30551 \pm 30 640±55640 \pm 55 579±48579 \pm 48 513±34513 \pm 34
    Horse colic 405±23405 \pm 23 417±17417 \pm 17 530±26530 \pm 26 446±28446 \pm 28 453±20453 \pm 20
    Labor 582±51582 \pm 51 542±44542 \pm 44 484±64484 \pm 64 403±54403 \pm 54 534±50534 \pm 50
    Liver disease 613±14613 \pm 14 646±20646 \pm 20 751±33751 \pm 33 707±29707 \pm 29 628±16628 \pm 16
    Promoters 473±40473 \pm 40 456±46456 \pm 46 569±90569 \pm 90 491±41491 \pm 41 357±25357 \pm 25
    Sonar 556±31556 \pm 31 638±38638 \pm 38 834±59834 \pm 59 608±37608 \pm 37 552±41552 \pm 41
    Voting 76±676 \pm 6 79±679 \pm 6 86±986 \pm 9 92±692 \pm 6 73±673 \pm 6
    10 Breast cancer 733±17733 \pm 17 707±25707 \pm 25 765±49765 \pm 49 981±44981 \pm 44 700±19700 \pm 19
    Credit 412±14412 \pm 14 403±21403 \pm 21 514±35514 \pm 35 427±22427 \pm 22 400±16400 \pm 16
    Diabetes 556±15556 \pm 15 577±16577 \pm 16 688±33688 \pm 33 623±21623 \pm 21 551±10551 \pm 10
    Echocardiogram 664±15664 \pm 15 678±17678 \pm 17 986±92986 \pm 92 884±53884 \pm 53 670±15670 \pm 15
    Heart disease 560±26560 \pm 26 576±22576 \pm 22 596±43596 \pm 43 514±39514 \pm 39 529±15529 \pm 15
    Hepatitis 667±38667 \pm 38 710±60710 \pm 60 942±97942 \pm 97 709±64709 \pm 64 675±49675 \pm 49
    Horse colic 643±14643 \pm 14 615±18615 \pm 18 730±37730 \pm 37 585±53585 \pm 53 596±13596 \pm 13
    Labor 666±29666 \pm 29 718±46718 \pm 46 682±72682 \pm 72 645±82645 \pm 82 634±31634 \pm 31
    Liver disease 580±13580 \pm 13 628±30628 \pm 30 847±48847 \pm 48 673±30673 \pm 30 580±13580 \pm 13
    Promoters 531±91531 \pm 91 429±19429 \pm 19 686±91686 \pm 91 573±58573 \pm 58 446±13446 \pm 13
    Sonar 540±26540 \pm 26 590±29590 \pm 29 947±88947 \pm 88 617±53617 \pm 53 490±20490 \pm 20
    Voting 105±11105 \pm 11 106±10106 \pm 10 106±13106 \pm 13 118±9118 \pm 9 106±10106 \pm 10

    Key takeaways from the lesion study:

    1. Ensemble averaging is essential: Estimating probabilities with a single run (C4 Probs) yields significantly worse costs across almost all datasets.
    2. Small resample counts suffice: Performance degrades only marginally from m=50m=50 down to m=10m=10.
    3. Probability estimates vs 0-1 voting: Using base-learner rule probabilities is moderately beneficial, but 0-1 vote counting still outperforms stratification and cost-blind C4.5R.
    4. Out-of-bag vs All models: Differences between out-of-bag estimation (q=Falseq=\text{False}) and using all models (q=Trueq=\text{True}) are minor.
  8. Knowl 8 — Scaling Up and Noise Robustness on the Space Shuttle Database

    data/table

    Evaluation on the NASA Shuttle database (43,500 training examples, 14,500 test examples, 7 classes, 9 numeric attributes) examined execution time and scalability. Costs were set to C(i,i)=0C(i, i) = 0 and C(i,j)=1000P(i)/P(j)C(i, j) = 1000 P(i)/P(j) for i≠ji \neq j. Tests were run on clean data and on data injected with 10%10\% uniform class noise.

    Algorithm No Noise 10% Noise
    Cost Time Cost Time
    C4.5R 15.615.6 1:41 2591.22591.2 91:56
    Undersampling 15.915.9 0:01 232.5232.5 1:40
    MetaCost (m=10,n=s/10m=10, n=s/10) 0.60.6 1:44 52.452.4 4:18
    MetaCost (m=10,n=s/100m=10, n=s/100) 0.70.7 0:15 53.253.2 0:17
    MetaCost (m=20,n=sm=20, n=s) 0.60.6 2:43 – –
    MetaCost (m=20,n=s/10m=20, n=s/10) 0.60.6 1:51 52.552.5 8:18
    MetaCost (m=50,n=sm=50, n=s) 0.60.6 28:49 – –
    MetaCost (m=50,n=s/10m=50, n=s/10) 0.60.6 2:38 52.552.5 21:35

    Note: Oversampling exceeded available memory in all runs; C4.5R under 10%10\% noise exceeded memory when running MetaCost with n=sn=s.

    On clean data, MetaCost with small subsamples (m=10,n=s/10m=10, n=s/10) reduces total cost by over an order of magnitude (15.6→0.615.6 \to 0.6) with run times comparable to baseline C4.5R. Under 10%10\% class noise, MetaCost with m=10,n=s/100m=10, n=s/100 executes in 17 seconds (over 300×300\times faster than C4.5R's 91:56) while cutting misclassification cost from 2591.22591.2 to 53.253.2. This acceleration occurs because ensemble averaging filters out random label noise, generating a cleaner training set on which rule induction produces drastically simpler rule sets.

  9. Knowl 9 — Computational and Structural Properties of MetaCost

    theoretical result

    MetaCost possesses three structural and computational properties:

    1. Independence from Cost Matrix Updates: The ensemble generation and class probability estimation stages (Steps 1 and 2 of the algorithm) depend entirely on the training set SS and are completely independent of the cost matrix CC. If the cost matrix changes, only the relabeling and final model training stages need to be repeated, requiring exactly one run of the base learner LL.
    2. Trivial Parallelization: Generating the mm resample models M1,…,MmM_1, \dots, M_m involves mutually independent executions of the learner LL. These runs can be distributed across mm processors, reducing the wall-clock overhead of the probability estimation stage to the cost of a single model induction.
    3. Asymptotic Large-Sample Consistency: In the infinite-sample limit (∣S∣→∞|S| \to \infty), if the base learning algorithm LL is statistically consistent under zero-one loss, training LL on a dataset relabeled according to the exact Bayes-optimal risk boundaries guarantees recovery of the true cost-minimizing decision frontiers.

Coverage note — None. All substantial contributions—including the MetaCost framework, Bayes risk relabeling formulation, algorithm specification, multiclass and binary benchmark evaluations, ablation lesion studies, and large-scale/noise scaling experiments on the Shuttle dataset—have been included.

References

  1. 1.D. W. Aha, D. Kibler, and M. K. Albert. Instance-based learning algorithms. Machine Learning, 6:37-66, 1991.
  2. 2.S. D. Bay. Combining nearest neighbor classifiers through multiple feature subsets. Proc. 17th Intl. Conf. on Machine Learning, pp. 37-45, Madison, WI, 1998.
  3. 3.C. M. Bishop. Neural Networks for Pattern Recognition. Oxford University Press, Oxford, UK, 1995.
  4. 4.C. Blake, E. Keogh, and C. J. Merz. UCI repository of machine learning databases. Dept. of Information and Computer Science, University of California at Irvine, CA, 1999. http://www.ics.uci.edu/~mlearn/MLRepository.html.
  5. 5.L. Breiman. Bagging predictors. Machine Learning, 24:123-140, 1996.
  6. 6.L. Breiman. Pasting bites together for prediction in large data sets and on-line. Technical report, Statistics Dept., University of California at Berkeley, CA, 1996.
  7. 7.L. Breiman. Out-of-bag estimation. Technical report, Statistics Dept., University of California at Berkeley, CA, 1998.
  8. 8.L. Breiman, J. H. Friedman, R. A. Olshen, and C. J. Stone. Classification and Regression Trees. Wadsworth, Belmont, CA, 1984.
  9. 9.P. Chan and S. Stolfo. Toward scalable learning with non-uniform class and cost distributions. Proc. 4th Intl. Conf. on Knowledge Discovery and Data Mining, pp. 164-168, New York, NY, 1998.
  10. 10.P. Chan, S. Stolfo, and D. Wolpert, editors. Proc. AAAI-96 Wkshp. on Integrating Multiple Learned Models for Improving and Scaling Machine Learning Algorithms. AAAI Press, Portland, OR, 1996.
  11. 11.B. W. Dasarathy, editor. Nearest Neighbor (NN) Norms: NN Pattern Classification Techniques. IEEE Computer Society Press, Los Alamitos, CA, 1991.
  12. 12.P. Domingos. Linear-time rule induction. Proc. 2nd Intl. Conf. on Knowledge Discovery and Data Mining, pp. 96-101, Portland, OR, 1996.
  13. 13.P. Domingos. Knowledge acquisition from examples via multiple models. Proc. 14th Intl. Conf. on Machine Learning, pp. 98-106, Nashville, TN, 1997.
  14. 14.P. Domingos. Why does bagging work? A Bayesian account and its implications. Proc. 3rd Intl. Conf. on Knowledge Discovery and Data Mining, pp. 155-158, Newport Beach, CA, 1997.
  15. 15.P. Domingos. How to get a free lunch: A simple cost model for machine learning applications. Proc. AAAI-98/ICML-98 Wkshp. on the Methodology of Applying Machine Learning, pp. 1-7, Madison, WI, 1998.
  16. 16.P. Domingos and M. Pazzani. On the optimality of the simple Bayesian classifier under zero-one loss. Machine Learning, 29:103-130, 1997.
  17. 17.R. O. Duda and P. E. Hart. Pattern Classification and Scene Analysis. Wiley, New York, NY, 1973.
  18. 18.U. Fayyad, G. Piatetsky-Shapiro, and P. Smyth. From data mining to knowledge discovery: An overview. In U. M. Fayyad, G. Piatetsky-Shapiro, P. Smyth, and R. Uthurusamy, editors, Advances in Knowledge Discovery and Data Mining, pp. 1-34. AAAI Press, Menlo Park, CA, 1996.
  19. 19.Y. Freund and R. E. Schapire. Experiments with a new boosting algorithm. Proc. 13th Intl. Conf. on Machine Learning, pp. 148-156, Bari, Italy, 1996.
  20. 20.R. S. Michalski. A theory and methodology of inductive learning. Artificial Intelligence, 20:111-161, 1983.
  21. 21.F. Provost and T. Fawcett. Analysis and visualization of classifier performance. Proc. 3rd Intl. Conf. on Knowledge Discovery and Data Mining, pp. 43-48, Newport Beach, CA, 1997.
  22. 22.F. Provost, T. Fawcett, and R. Kohavi. The case against accuracy estimation for comparing induction algorithms. Proc. 15th Intl. Conf. on Machine Learning, pp. 445-453, Madison, WI, 1998.
  23. 23.J. R. Quinlan. C4.5: Programs for Machine Learning. Morgan Kaufmann, San Mateo, CA, 1993.
  24. 24.K. M. Ting and Z. Zheng. Boosting trees for cost-sensitive classifications. Proc. 10th European Conf. on Machine Learning, pp. 191-195, Chemnitz, Germany, 1998.
  25. 25.P. Turney. Cost-sensitive learning bibliography. Online bibliography, Institute for Information Technology of the National Research Council of Canada, Ottawa, Canada, 1997. http://ai.iit.nrc.ca/bibliographies/cost-sensitive.html.
  26. 26.Z. Zheng. Naive Bayesian classifier committees. Proc. 10th European Conf. on Machine Learning, pp. 196-207, Chemnitz, Germany, 1998.

Citation

MLA
Domingos, P. “MetaCost”. Proceedings of the Fifth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 1999, pp. 155–64, https://doi.org/10.1145/312129.312220.
APA
Domingos, P. (1999). MetaCost. Proceedings of the Fifth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 155–164. https://doi.org/10.1145/312129.312220
Chicago
Domingos, P. 1999. “MetaCost”. Proceedings of the Fifth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 155–64. https://doi.org/10.1145/312129.312220.
Harvard
Domingos, P. (1999) “MetaCost”, Proceedings of the fifth ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, pp. 155–164. Available at: https://doi.org/10.1145/312129.312220.
Vancouver
1. Domingos P (1999) MetaCost. In: Proceedings of the fifth ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, pp 155–164

BibTeX

@inproceedings{Domingos_1999, series={KDD99}, title={MetaCost: a general method for making classifiers cost-sensitive}, url={http://dx.doi.org/10.1145/312129.312220}, DOI={10.1145/312129.312220}, booktitle={Proceedings of the fifth ACM SIGKDD international conference on Knowledge discovery and data mining}, publisher={ACM}, author={Domingos, Pedro}, year={1999}, month=Aug, pages={155–164}, collection={KDD99} }
Metadata:Crossref

Access the Paper

This paper is available from its original source. Click below to access the PDF.

Open PDF