Skip to main content

Confidence Ensembles to Improve Classification

Project description

Confidence Ensembles

Python Frameworkthat implements confidence ensembles: ConfBag and ConfBoost

Aim/Concept of the Project

One of the biggest ICT challenges of the current era is to solve classification problems by designing and training Machine Learning (ML) algorithms that assign a discrete label to input data with perfect accuracy i.e., no misclassifications. These classifiers can be used for solving a wide variety of tasks processing either structured tabular data or unstructured inputs (e.g., images) for binary or multi-class classification. In real-world applications, the most common data type is tabular data, comprising samples (rows) with the same set of features (columns). Tabular data is used in practical applications in many fields, and especially when stakeholders aim at monitoring the behavior of ICT systems for an early detection of anomalies, errors, or intrusions. Noticeably, monitoring activities generate a massive amount of (tabular) data that could be potentially used for classification but, unfortunately, is hardly labeled. In this case, the classification process can only be unsupervised, leading to well-known detrimental effects on the overall accuracy of the machinery, making it practically unusable in practice aside from specific corner cases.

To deal with these problems, ML experts and researchers keep designing new algorithms and providing trained models that have the potential to outperform their baseline on specific scenarios, can or cannot deal with unsupervised learning, and perform well under specific assumptions (e.g., the closed-world assumption of Independent and Identically Distributed (IID) train, validation, and test data). Constraining experiments behind such assumptions may be acceptable and suitable for research purposes but does not fit the deployment of classifiers for critical ICT systems, which are complex systems whose failure could directly impact the health of people, infrastructures, or the environment. Adopting classifiers to operate critical functions requires very low misclassification probability and to prepare countermeasures that avoid or mitigate the potential cascading effects of misclassifications to the encompassing critical system.

We tackle these problems by designing, implementing and benchmarking classifiers that are more accurate and robust than baselines, potentially becoming reliable enough to be deployed in the wild in critical real-world systems. Confidence ensembles, either Confidence Bagging (ConfBag) or Confidence Boosting (ConfBoost), can use any existing classifier as a base estimator, and build a meta-classifier through a training process that does not require any additional information with respect to those that are already used to train the base estimator. ConfBag reworks the traditional bagging by using only the most confident base-learners to assign the label to input data, whereas ConfBoost creates base-learners that are more and more specialized to classify train data items for which other base-learners cannot make a confident prediction. This is radically different from the typical boosting strategies, which always require a labeled training set as base-learners are typically trained using train data that gets misclassified by other base-learners. As a result, ConfBag and ConfBoost:

  • can work with any existing classifier as base estimator, which is used to create base-learners;
  • have a generic and quite straightforward architecture that applies to all classification tasks and scenarios: (semi-)supervised or unsupervised, binary or multi-class, and can deal with tabular, image, or even textual input data;
  • do not require additional information with respect to those already needed by the base estimator;
  • require little to no parameter tuning, are easy to use even from non-experts, and are implemented in a public Python framework that exposes interfaces that comply with de-facto standard libraries such as scikit-learn.

Dependencies

confidence-ensembles needs the following libraries:

Usage

confidence-ensembles can wrap any classifier you may want to use, provided that the classifier implements scikit-learn like interfaces, namely

  • classifier.fit(train_features, train_labels (optional)): trains the classifier; labels are optional (applies to unsupervised learning)
  • classifier.predict_proba(test_set): takes a 2D ndarray and returns a 2D ndarray where each line contains probabilities for a given data point in the test_set

Assuming the classifier has such a structure, a confidence ensemble can be set up as it can be seen in the test folder

Snippet for supervised learning

https://github.com/tommyippoz/confidence-ensembles/blob/dbdcf730c55cc82505380c60339179e0d1a129c9/tests/example_supervised.py#L50-L64

Snippet for unsupervised learning

https://github.com/tommyippoz/confidence-ensembles/blob/8bbca5446fa912174dd78fbb9bcc03c19d5a166c/tests/example_unsupervised.py#L54-L69

Credits

Please Cite

  • Zoppi, T., & Popov, P. (2025). Confidence Ensembles: Tabular Data Classifiers on Steroids. Information Fusion, 103126.

Contributors

  • Tommaso Zoppi
  • Peter Popov

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confidence_ensembles-0.9.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

confidence_ensembles-0.9-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file confidence_ensembles-0.9.tar.gz.

File metadata

  • Download URL: confidence_ensembles-0.9.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for confidence_ensembles-0.9.tar.gz
Algorithm Hash digest
SHA256 604383e4b83477a0ac797fcbdf4059a6bb4f58b26a6e06371f7f5bcebbb6d725
MD5 6de72e1a9eb66afcdd9120bd3ae37990
BLAKE2b-256 7b3f18117240cd1f6f851e7d54c258a1ca1ad2bc6e63cda17aa7f920c9f33fa2

See more details on using hashes here.

File details

Details for the file confidence_ensembles-0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for confidence_ensembles-0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2bcb3b2f211ce18d24908a179841312934bb5c593de1fe1857d9fddfa2c44dfe
MD5 2cf8d4b8c3cc1e3afeea500027368289
BLAKE2b-256 ed921320badde7f0a4dae229260f78ee45cedf6034c5b12320efea4cd1703403

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page