Skip to content

Commit

Permalink
Merge pull request #85 from JuliaTrustworthyAI/62-full-module-for-con…
Browse files Browse the repository at this point in the history
…formal-training

bumped version and compat entries
  • Loading branch information
pat-alt authored Aug 23, 2023
2 parents e8def6a + b071549 commit e758c2f
Show file tree
Hide file tree
Showing 13 changed files with 374 additions and 320 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.7'
- '1.8'
- '1.9'
Expand Down
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ConformalPrediction"
uuid = "98bfc277-1877-43dc-819b-a3e38c30242f"
authors = ["Patrick Altmeyer"]
version = "0.1.8"
version = "0.1.9"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
Expand All @@ -26,6 +26,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
[compat]
CategoricalArrays = "0.10"
ChainRules = "1.49.0"
ComputationalResources = "0.3"
Flux = "0.13.16, 0.14"
MLJBase = "0.20, 0.21"
MLJEnsembles = "0.3.3"
Expand All @@ -34,7 +35,9 @@ MLJModelInterface = "1"
MLUtils = "0.4.2"
NaturalSort = "1"
Plots = "1"
ProgressMeter = "1"
StatsBase = "0.33, 0.34.0"
Tables = "1"
julia = "1.7, 1.8, 1.9"

[extras]
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![](dev/logo/wide_logo.png)

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliatrustworthyai.github.io/ConformalPrediction.jl/stable/) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliatrustworthyai.github.io/ConformalPrediction.jl/dev/) [![Build Status](https://github.com/juliatrustworthyai/ConformalPrediction.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/juliatrustworthyai/ConformalPrediction.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Coverage](https://codecov.io/gh/juliatrustworthyai/ConformalPrediction.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/juliatrustworthyai/ConformalPrediction.jl) [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle) [![ColPrac: Contributor’s Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet.png)](https://github.com/SciML/ColPrac) [![Twitter Badge](https://img.shields.io/twitter/url/https/twitter.com/paltmey.svg?style=social&label=Follow%20%40paltmey)](https://twitter.com/paltmey)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliatrustworthyai.github.io/ConformalPrediction.jl/stable/) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliatrustworthyai.github.io/ConformalPrediction.jl/dev/) [![Build Status](https://github.com/juliatrustworthyai/ConformalPrediction.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/juliatrustworthyai/ConformalPrediction.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Coverage](https://codecov.io/gh/juliatrustworthyai/ConformalPrediction.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/juliatrustworthyai/ConformalPrediction.jl) [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle) [![License](https://img.shields.io/github/license/juliatrustworthyai/ConformalPrediction.jl)](LICENSE) [![Package Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/ConformalPrediction/.png)](https://pkgs.genieframework.com?packages=ConformalPrediction)

`ConformalPrediction.jl` is a package for Predictive Uncertainty Quantification (UQ) through Conformal Prediction (CP) in Julia. It is designed to work with supervised models trained in [MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) (Blaom et al. 2020). Conformal Prediction is easy-to-understand, easy-to-use and model-agnostic and it works under minimal distributional assumptions.

Expand Down Expand Up @@ -71,7 +71,7 @@ X = reshape(X, :, 1)

# Outputs:
noise = 0.5
fun(X) = X * sin(X)
fun(X) = sin(X)
ε = randn(N) .* noise
y = @.(fun(X)) + ε
y = vec(y)
Expand Down Expand Up @@ -111,11 +111,11 @@ ŷ[1:show_first]
```

5-element Vector{Tuple{Float64, Float64}}:
(-0.40997718991694765, 1.449009293726001)
(0.8484810430118421, 2.7074675266547907)
(0.547852151594671, 2.4068386352376194)
(-0.022697652913589494, 1.8362888307293592)
(0.07435130847990101, 1.9333377921228496)
(0.0458889297242715, 1.9182762960257687)
(-1.9174452847238976, -0.04505791842240037)
(-1.2544275358451678, 0.6179598304563294)
(-0.2818835218505735, 1.5905038444509236)
(0.01299565032151917, 1.8853830166230163)

For simple models like this one, we can call a custom `Plots` recipe on our instance, fit result and data to generate the chart below:

Expand All @@ -138,8 +138,6 @@ println("Empirical coverage: $(round(_eval.measurement[1], digits=3))")
println("SSC: $(round(_eval.measurement[2], digits=3))")
```

Started!

PerformanceEvaluation object with these fields:
measure, operation, measurement, per_fold,
per_observation, fitted_params_per_fold,
Expand All @@ -148,11 +146,14 @@ println("SSC: $(round(_eval.measurement[2], digits=3))")
┌──────────────────────────────────────────────┬───────────┬─────────────┬──────
│ measure │ operation │ measurement │ 1.9 ⋯
├──────────────────────────────────────────────┼───────────┼─────────────┼──────
│ ConformalPrediction.emp_coverage │ predict │ 0.945 │ 0.0 ⋯
│ ConformalPrediction.size_stratified_coverage │ predict │ 0.945 │ 0.0 ⋯
│ ConformalPrediction.emp_coverage │ predict │ 0.948 │ 0.0 ⋯
│ ConformalPrediction.size_stratified_coverage │ predict │ 0.948 │ 0.0 ⋯
└──────────────────────────────────────────────┴───────────┴─────────────┴──────
2 columns omitted

Empirical coverage: 0.948
SSC: 0.948

## 📚 Read on

If after reading the usage example above you are just left with more questions about the topic, that’s normal. Below we have have collected a number of further resources to help you get started with this package and the topic itself:
Expand Down Expand Up @@ -231,7 +232,7 @@ There is also a simple `Plots.jl` recipe that can be used to inspect the set siz
bar(mach.model, mach.fitresult, X)
```

![](README_files/figure-commonmark/cell-11-output-1.svg)
![](README_files/figure-commonmark/cell-12-output-1.svg)

## 🛠 Contribute

Expand Down
4 changes: 2 additions & 2 deletions README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jupyter: julia-1.9
[![Build Status](https://github.com/juliatrustworthyai/ConformalPrediction.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/juliatrustworthyai/ConformalPrediction.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Coverage](https://codecov.io/gh/juliatrustworthyai/ConformalPrediction.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/juliatrustworthyai/ConformalPrediction.jl)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![Twitter Badge](https://img.shields.io/twitter/url/https/twitter.com/paltmey.svg?style=social&label=Follow%20%40paltmey)](https://twitter.com/paltmey)
[![License](https://img.shields.io/github/license/juliatrustworthyai/ConformalPrediction.jl)](LICENSE)
[![Package Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/ConformalPrediction/)](https://pkgs.genieframework.com?packages=ConformalPrediction)

{{< include docs/src/_intro.qmd >}}
Loading

2 comments on commit e758c2f

@pat-alt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/90142

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.9 -m "<description of version>" e758c2f96cb46ebcf31fb20f4f7475bb88227a95
git push origin v0.1.9

Please sign in to comment.