Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Build Status Documentation Status

The Uncertainty Quantification 360 (UQ360) is an open-source toolkit with a Python package to provide data science practitioners and developers access to state-of-the-art algorithms, to streamline the process of estimating, evaluating, improving, and communicating uncertainty of machine learning models as common practices for AI transparency. The UQ360 interactive experience provides a gentle introduction to the concepts and capabilities by walking through an example use case. The tutorials and example notebooks offer a deeper, data scientist-oriented introduction. The complete API is also available.

We have developed the package with extensibility in mind. This library is still in development. We encourage the contribution of your uncertainty estimation algorithms, metrics and applications. To get started as a contributor, please join the #uq360-users or #uq360-developers channel of the AIF360 Community on Slack by requesting an invitation here.

alt text


Example Use-cases


Use of meta-models to augment sklearn's gradient boosted regressor with prediction interval. See detailed example here.

from sklearn.ensemble import GradientBoostingRegressor
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split

from uq360.algorithms.blackbox_metamodel import MetamodelRegression

# Create train, calibration and test splits.
X, y = make_regression(random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
X_train, X_calibration, y_train, y_calibration = train_test_split(X_train, y_train, random_state=0)

# Train the base model that provides the mean estimates.
gbr_reg = GradientBoostingRegressor(random_state=0), y_train)

# Train the meta-model that can augment the mean prediction with prediction intervals.
uq_model = MetamodelRegression(base_model=gbr_reg), y_calibration, base_is_prefitted=True)

# Obtain mean estimates and prediction interval on the test data.
y_hat, y_hat_lb, y_hat_ub = uq_model.predict(X_test)

UQ360 metrics for model selection

The prediction interval coverage probability score (PICP) score is used here as the metric to select the model through cross-validation. See detailed example here.

from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from uq360.utils.misc import make_sklearn_compatible_scorer
from uq360.algorithms.quantile_regression import QuantileRegression

# Create a sklearn scorer using UQ360 PICP metric.
sklearn_picp = make_sklearn_compatible_scorer(
    metric="picp", greater_is_better=True)

# Hyper-parameters configuration using GridSearchCV.
base_config = {"alpha":0.95, "n_estimators":20, "max_depth": 3, 
               "learning_rate": 0.01, "min_samples_leaf": 10,
               "min_samples_split": 10}
configs  = {"config": []}
for num_estimators in [1, 2, 5, 10, 20, 30, 40, 50]:
    config = base_config.copy()
    config["n_estimators"] = num_estimators

# Create train test split.
X, y = make_regression(random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)

# Initialize QuantileRegression UQ360 model and wrap it in GridSearchCV with PICP as the scoring function.
uq_model = GridSearchCV(
    QuantileRegression(config=base_config), configs, scoring=sklearn_picp)

# Fit the model on the training set., y_train)

# Obtain the prediction intervals for the test set.
y_hat, y_hat_lb, y_hat_ub = uq_model.predict(X_test)


Supported Configurations:

OS Python version
macOS 3.7
Ubuntu 3.7
Windows 3.7

(Optional) Create a virtual environment

A virtual environment manager is strongly recommended to ensure dependencies may be installed safely. If you have trouble installing the toolkit, try this first.


Conda is recommended for all configurations though Virtualenv is generally interchangeable for our purposes. Miniconda is sufficient (see the difference between Anaconda and Miniconda if you are curious) and can be installed from here if you do not already have it.

Then, to create a new Python 3.7 environment, run:

conda create --name uq360 python=3.7
conda activate uq360

The shell should now look like (uq360) $. To deactivate the environment, run:

(uq360)$ conda deactivate

The prompt will return back to $ or (base)$.

Note: Older versions of conda may use source activate uq360 and source deactivate (activate uq360 and deactivate on Windows).


Clone the latest version of this repository:

(uq360)$ git clone

If you'd like to run the examples and tutorial notebooks, download the datasets now and place them in their respective folders as described in uq360/data/

Then, navigate to the root directory of the project which contains file and run:

(uq360)$ pip install -e .

PIP Installation of Uncertainty Quantification 360

If you would like to quickly start using the UQ360 toolkit without cloning this repository, then you can install the uq360 pypi package as follows.

(your environment)$ pip install uq360

If you follow this approach, you may need to download the notebooks in the examples folder separately.

Using UQ360

The examples directory contains a diverse collection of jupyter notebooks that use UQ360 in various ways. Both examples and tutorial notebooks illustrate working code using the toolkit. Tutorials provide additional discussion that walks the user through the various steps of the notebook. See the details about tutorials and examples here.

Citing UQ360

A technical description of UQ360 is available in this paper. Below is the bibtex entry for this paper.

      title={Uncertainty Quantification 360: A Holistic Toolkit for Quantifying 
      and Communicating the Uncertainty of AI}, 
      author={Soumya Ghosh and Q. Vera Liao and Karthikeyan Natesan Ramamurthy 
      and Jiri Navratil and Prasanna Sattigeri 
      and Kush R. Varshney and Yunfeng Zhang},


UQ360 is built with the help of several open source packages. All of these are listed in and some of these include:

License Information

Please view both the LICENSE file present in the root directory for license information.