Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A library for the evaluation of model performance and estimation of the uncertainty on these metrics.
.. figure:: docs/source/figs/pr_curve_mult_w_points.png :alt: Uncertainty on the precision-recall curve :align: center
.. image:: https://github.com/RUrlus/ModelMetricUncertainty/actions/workflows/macos.yml/badge.svg?branch=stable :target: https://github.com/RUrlus/ModelMetricUncertainty/actions/workflows/macos.yml :alt: MacOS build .. image:: https://github.com/RUrlus/ModelMetricUncertainty/actions/workflows/linux.yml/badge.svg?branch=stable :target: https://github.com/RUrlus/ModelMetricUncertainty/actions/workflows/linux.yml :alt: Linux build .. image:: https://github.com/RUrlus/ModelMetricUncertainty/actions/workflows/windows.yml/badge.svg?branch=stable :target: https://github.com/RUrlus/ModelMetricUncertainty/actions/workflows/windows.yml :alt: Windows build .. image:: https://readthedocs.org/projects/mmu/badge/?version=latest :target: https://mmu.readthedocs.io/en/latest/?badge=latest :alt: Documentation .. image:: https://img.shields.io/github/license/RUrlus/modelmetricuncertainty :target: https://github.com/RUrlus/carma/blob/stable/LICENSE :alt: License .. image:: http://img.shields.io/pypi/v/mmu.svg :target: https://pypi.org/project/mmu/ :alt: PyPi
Documentation <https://mmu.readthedocs.io/en/latest/>
_On a high level MMU
provides two types of functionality:
We currently focus on binary classification models but aim to include support for other types of models and their metrics in the future.
Confusion Matrix & Metrics
Metrics consist mainly of high-performance functions to compute the confusion matrix and metrics over a single test set, multiple classification thresholds and or multiple runs.
The binary_metrics
functions compute the 10 most commonly used metrics:
Uncertainty estimators
MMU provides two methods for modelling the joint uncertainty on precision and recall: Multinomial uncertainty and Bivariate-Normal.
The Multinomial approach estimates the uncertainty by computing the profile log-likelihoods scores for a grid around the precision and recall. The scores are chi2 distributed with 2 degrees of freedom which can be used to determine the confidence interval.
The Bivariate-Normal approach models the statistical uncertainty over the linearly propagated errors of the confusion matrix and the analytical covariance matrix. The resulting joint uncertainty is elliptical in nature.
mmu
can be installed from PyPi.
.. code-block:: bash
pip install mmu
We provide wheels for:
Installing the package from source requires a C++ compiler with support for C++14. If you have a compiler available it is advised to install without the wheel as this enables architecture specific optimisations.
.. code-block:: bash
pip install mmu --no-binary mmu
Other build options exist, see the Installation section <https://mmu.readthedocs.io/en/latest/installation.html>
_ of the docs.
.. code-block:: python3
import mmu
# Create some example data
scores, yhat, y = mmu.generate_data(n_samples=1000)
# Compute the joint uncertainty on precision-recall curve
pr_err = mmu.PrecisionRecallCurveUncertainty.from_scores(y, scores)
# Plot the uncertainty
pr_err.plot()
See Basics section <https://mmu.readthedocs.io/en/latest/basics.html>
_ of the docs or the tutorial notebooks <https://github.com/RUrlus/ModelMetricUncertainty/blob/stable/notebooks>
_ for more examples.
We very much welcome contributions, please see the contributing section <https://mmu.readthedocs.io/en/latest/contributing.html>
_ for details.
FAQs
Compute uncertainties on classification model metrics.
We found that mmu demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.