项目作者: GiovanniCiampi

项目描述 :
This repo contains code to perform Bootstrap Confidence Intervals estimation (a.k.a. Monte Carlo Confidence Interval or Empirical Confidence Interval estimation) for Machine Learing models.
高级语言: Jupyter Notebook
项目地址: git://github.com/GiovanniCiampi/confidence_interval_estimator_ML.git
创建时间: 2020-12-29T16:26:04Z
项目社区:https://github.com/GiovanniCiampi/confidence_interval_estimator_ML

开源协议:GNU General Public License v3.0

下载


confidence_interval_estimator_ML

This repo contains code to perform estimation of Confidence Intervals both parametrically and non-parametrically (a.k.a. Monte Carlo Confidence Interval/Empirical Confidence Interval/Bootstrap Confidence Interval estimation) for Machine Learing models.

Colab Demo

You can easily try this tool in Google Colab by clicking on the following badge: Open In Colab

Quickstart

  1. >>> import confidence_interval_estimator_ML.utils as cie
  2. >>> # Parametric Estimation:
  3. >>> cie.parametric_confidence_interval(confidence_level=.95, mean=model_accuracy, sample_size=sample_size, verbose=True)
  4. Computing C.I. assuming the data follow a standard normal distribution
  5. With 95.0% confidence the accuracy of the model is in 0.977 +/-0.023.
  6. (0.9773132867658845, 0.02268671323411553)
  7. >>> # Non-Parametric Estimation:
  8. >>> test_accuracies = cie.get_accuracy_samples(get_classifier_instance, X, y, n_iterations=100, sample_ratio=1,
  9. train_ratio=0.8, random_seed=None, sample_with_replacement=True, verbose=False)
  10. >>> cie.nonparametric_confidence_interval(test_accuracies, confidence_level=.9)
  11. From the given data, with 90.0% confidence the accuracy of the model is in 0.959 +/-0.045.
  12. (0.9595, 0.04050000000000009)

Further Details

You can find further details on the usage of the tool in the code documentation or in the examples provided in the colab notebook. If you need help, please don’t hesitate to open a github issue or contact me.