Code Monkey home page Code Monkey logo

mcboost's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mcboost's Issues

Vignettes

    1. Usage and Examples
    1. Multi-calibration paper reproduction
    1. NHS Dataset

contributions.md

We should create file where every author's contributions are briefly explained

Bug in SubgroupModel$fit

https://github.com/pfistfl/mcboost/blob/ae92185f85bfc28be9f7c7e84848e63543df0c17/R/Predictor.R#L193

If mask is a binary vector e.g. c(0, 1, 0, 1, 0, 0), this line returns mean(c(abels[1], labels[1])).
Instead we want mean(c(labels[2], labels[4])), right?

Minimal example:

data = data.frame(X1 = rnorm(n = 10L), X2 = rnorm(n = 10L))
masks =  list(
    rep(c(1, 0), 5)
 )
sf = SubgroupFitter$new(masks)
resid = c(1, rep(0, 9)) 
sm =  SubgroupModel$new(masks)
mn = sm$fit(data = data, labels = resid) # returns mean of 1s no 0 included 

Do proper gradient boosting for brier score optimization

The approach proposed in the papers optimizes the brier score through the assumption of predicted probabilities (which can be added or multiplicatively updated).
A proper gradient boosting setup where scores are optimized could be a worthwhile addition.

Adapt code to list of datasets

In the original paper, the validation data is a list of batches (instead of a single validation set).
Adapt code to allow for it, although this is probably not used in practice.

Release mcboost 0.3.0

First release:

Prepare for release:

  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Update install instructions in README

Create Extension to Survival Task

Additionally to a classification task, mcboost should also be able to handle survival tasks:

The main differences are:

  • compute residuals based on the derivate of the Integrated Brier Score (with right-censoring)
  • deal with individual distributions of survival probabilities instead of individual probabilities (also includes a new variables times)

Run multicalibration on pre-computed scores w/o access to initial predictor

I'm trying to multi-calibrate scores precomputed from a black-box model (assume we don't have access to the model itself) but I'm getting non-sensical results.

I'm wondering if this should work in theory (and there's some other bug in my code) or if there's a more fundamental reason this doesn't work.

Here's an example to illustrate what I'm trying to do:

library(mcboost)

# simulate some random data
n = 100
scores = runif(n)
labels = rbinom(n, 1, scores)
is_test = as.logical(rbinom(n, 1, 0.1))
segmentation_features = data.table(
    cbind(
        rbinom(n, 1, 0.1),
        rbinom(n, 1, 0.5)
    )
)

init_predictor = function(data) {
    # Hack to make it return pre-computed scores for train/test since we don't have access to the model
    if(nrow(data) > 50) {
        scores[!is_test]
    } else {
        scores[is_test]
    }
}

mc = MCBoost$new(
    auditor_fitter="TreeAuditorFitter", 
    init_predictor=init_predictor
)

mc$multicalibrate(
    segmentation_features[!is_test],
    labels[!is_test]
)
mc

prs = mc$predict_probs(segmentation_features[is_test])

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.