confidence-ensembles


Nameconfidence-ensembles JSON
Version 0.6 PyPI version JSON
download
home_pagehttps://github.com/tommyippoz/confidence-ensembles
SummaryConfidence Ensembles to Improve Classification
upload_time2024-06-11 08:45:07
maintainerNone
docs_urlNone
authorTommaso Zoppi
requires_pythonNone
licenseNone
keywords machine learning confidence safety ensemble
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:
- <a href="https://numpy.org/">NumPy</a>
- <a href="https://scipy.org/">SciPy</a>
- <a href="https://pandas.pydata.org/">Pandas</a>
- <a href="https://scikit-learn.org/stable/">Scikit-Learn</a>
- <a href="https://github.com/yzhao062/pyod">PYOD</a>

## 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

Developed @ University of Trento, Povo, Italy, and University of Florence, Florence, Italy

Contributors
- Tommaso Zoppi

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tommyippoz/confidence-ensembles",
    "name": "confidence-ensembles",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "machine learning, confidence, safety, ensemble",
    "author": "Tommaso Zoppi",
    "author_email": "tommaso.zoppi@unitn.it",
    "download_url": "https://files.pythonhosted.org/packages/5f/95/f53b352e6201b120a04784a6c31c57f419ced93831a0e28d089c84859538/confidence_ensembles-0.6.tar.gz",
    "platform": null,
    "description": "# Confidence Ensembles\r\n\r\nPython Frameworkthat implements confidence ensembles: ConfBag and ConfBoost\r\n\r\n## Aim/Concept of the Project\r\n\r\nOne 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.\r\n\r\nTo 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.\r\n\r\nWe 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. \r\nAs a result, ConfBag and ConfBoost:\r\n- can work with any existing classifier as base estimator, which is used to create base-learners;\r\n-\thave 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; \r\n-\tdo not require additional information with respect to those already needed by the base estimator;\r\n-\trequire 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. \r\n\r\n## Dependencies\r\n\r\nconfidence-ensembles needs the following libraries:\r\n- <a href=\"https://numpy.org/\">NumPy</a>\r\n- <a href=\"https://scipy.org/\">SciPy</a>\r\n- <a href=\"https://pandas.pydata.org/\">Pandas</a>\r\n- <a href=\"https://scikit-learn.org/stable/\">Scikit-Learn</a>\r\n- <a href=\"https://github.com/yzhao062/pyod\">PYOD</a>\r\n\r\n## Usage\r\n\r\nconfidence-ensembles can wrap any classifier you may want to use, provided that the classifier implements scikit-learn like interfaces, namely\r\n- classifier.fit(train_features, train_labels (optional)): trains the classifier; labels are optional (applies to unsupervised learning)\r\n- 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\r\n\r\nAssuming the classifier has such a structure, a confidence ensemble can be set up as it can be seen in the `test` folder\r\n\r\nSnippet for supervised learning\r\n\r\nhttps://github.com/tommyippoz/confidence-ensembles/blob/dbdcf730c55cc82505380c60339179e0d1a129c9/tests/example_supervised.py#L50-L64\r\n\r\nSnippet for unsupervised learning\r\n\r\nhttps://github.com/tommyippoz/confidence-ensembles/blob/8bbca5446fa912174dd78fbb9bcc03c19d5a166c/tests/example_unsupervised.py#L54-L69\r\n\r\n## Credits\r\n\r\nDeveloped @ University of Trento, Povo, Italy, and University of Florence, Florence, Italy\r\n\r\nContributors\r\n- Tommaso Zoppi\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Confidence Ensembles to Improve Classification",
    "version": "0.6",
    "project_urls": {
        "Homepage": "https://github.com/tommyippoz/confidence-ensembles"
    },
    "split_keywords": [
        "machine learning",
        " confidence",
        " safety",
        " ensemble"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "341f36c3055a68e2a653328f1a7fb976ac04b3e19d35a2dbdf376553ba2bc133",
                "md5": "593ac1a6259d313493decdda7ac4fbb3",
                "sha256": "558be30c5f743ebbd6e9174743d1b213ab98422c99ae8933b6dd099f036f9f87"
            },
            "downloads": -1,
            "filename": "confidence_ensembles-0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "593ac1a6259d313493decdda7ac4fbb3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 31144,
            "upload_time": "2024-06-11T08:45:06",
            "upload_time_iso_8601": "2024-06-11T08:45:06.021922Z",
            "url": "https://files.pythonhosted.org/packages/34/1f/36c3055a68e2a653328f1a7fb976ac04b3e19d35a2dbdf376553ba2bc133/confidence_ensembles-0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f95f53b352e6201b120a04784a6c31c57f419ced93831a0e28d089c84859538",
                "md5": "7cf0154fc25f26fbbdd7821e8c42981e",
                "sha256": "1a43e4eed600c98688f048126c8a19e30871533c2733ca13fd4fdac5695abbc0"
            },
            "downloads": -1,
            "filename": "confidence_ensembles-0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "7cf0154fc25f26fbbdd7821e8c42981e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 21524,
            "upload_time": "2024-06-11T08:45:07",
            "upload_time_iso_8601": "2024-06-11T08:45:07.894698Z",
            "url": "https://files.pythonhosted.org/packages/5f/95/f53b352e6201b120a04784a6c31c57f419ced93831a0e28d089c84859538/confidence_ensembles-0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-11 08:45:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tommyippoz",
    "github_project": "confidence-ensembles",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "confidence-ensembles"
}
        
Elapsed time: 3.49470s