Giter VIP home page Giter VIP logo

silhouetteq / ml-stat-util Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mateuszbuda/ml-stat-util

0.0 0.0 0.0 23 KB

Statistical functions based on bootstrapping for computing confidence intervals and p-values comparing machine learning models and human readers

Home Page: https://mateuszbuda.github.io/2019/04/30/stat.html

License: MIT License

Dockerfile 0.66% Python 19.52% Jupyter Notebook 79.83%

ml-stat-util's Introduction

Machine Learning Statistical Utils

Docker setup for example jupyter notebook

docker build -t stat-util .
docker run --rm -p 8889:8889 -v `pwd`:/workspace stat-util

Use cases

Code for all use cases is provided in examples.ipynb notebook.

Evaluate a model with 95% confidence interval

from sklearn.metrics import roc_auc_score

import stat_util


score, ci_lower, ci_upper, scores = stat_util.score_ci(
    y_true, y_pred, score_fun=roc_auc_score
)

Compute p-value for comparison of two models

from sklearn.metrics import roc_auc_score

import stat_util


p, z = stat_util.pvalue(y_true, y_pred1, y_pred2, score_fun=roc_auc_score)

Compute mean performance with 95% confidence interval for a set of readers

import numpy as np
from sklearn.metrics import roc_auc_score

import stat_util


mean_score, ci_lower, ci_upper, scores = stat_util.score_stat_ci(
    y_true, y_pred_readers, score_fun=roc_auc_score, stat_fun=np.mean
)

Compute p-value for comparison of one model and a set of readers

import numpy as np
from sklearn.metrics import roc_auc_score

import stat_util


p, z = stat_util.pvalue_stat(
    y_true, y_pred, y_pred_readers, score_fun=roc_auc_score, stat_fun=np.mean
)

ml-stat-util's People

Contributors

mateuszbuda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.