Giter VIP home page Giter VIP logo

calibcurve's Introduction

calibcurve

calibcurve implements functions to compute true and predicted probabilities and visualise a calibration curve, aka reliability diagram (Niculescu-Mizil & Caruana, 2005).

  • calibcurve is powered by the yardstick’s infrastructure and its implementation of related curve metrics.

  • calibcurve borrowed some ideas from sklearn’s calibration module.

Installation

You can install the released version of calibcurve from CRAN with:

# install.packages("calibcurve")
# Not yet!

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("chuvanan/calibcurve")

Example

This is a basic example which shows you how to solve a common problem:

library(calibcurve)
library(magrittr)
library(ggplot2)

data(two_class_example, package = "yardstick")
head(two_class_example)
#>    truth      Class1       Class2 predicted
#> 1 Class2 0.003589243 0.9964107574    Class2
#> 2 Class1 0.678621054 0.3213789460    Class1
#> 3 Class2 0.110893522 0.8891064779    Class2
#> 4 Class1 0.735161703 0.2648382969    Class1
#> 5 Class2 0.016239960 0.9837600397    Class2
#> 6 Class1 0.999275071 0.0007249286    Class1

two_class_example %>%
    calibration_curve(truth, Class1)
#> # A tibble: 10 x 2
#>    .mean_predicted .frac_positive
#>              <dbl>          <dbl>
#>  1        0.000626           0   
#>  2        0.0122             0.02
#>  3        0.0777             0.14
#>  4        0.213              0.26
#>  5        0.498              0.38
#>  6        0.762              0.56
#>  7        0.913              0.86
#>  8        0.978              0.98
#>  9        0.994              0.96
#> 10        0.999              1

two_class_example %>%
    calibration_curve(truth, Class1) %>%
    autoplot()

Code of Conduct

Please note that the calibcurve project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

calibcurve's People

Contributors

chuvanan avatar

Stargazers

 avatar  avatar

Watchers

 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.