Code Monkey home page Code Monkey logo

Comments (3)

bcjaeger avatar bcjaeger commented on August 14, 2024 1

Should be good to go now. Thank you for the suggestion and the great example!

library(aorsf)
library(survival)

lung_orsf <- na.omit(lung)
lung_orsf$surv <- Surv(lung_orsf$time, lung_orsf$status)
lung_orsf <- lung_orsf[, -c(2,3)]

fit <- orsf(lung_orsf, formula = surv ~ age + ph.ecog)

predict(fit, new_data = lung_orsf[1:5, ])
#>           [,1]
#> [1,] 0.3283840
#> [2,] 0.3673719
#> [3,] 0.3346957
#> [4,] 0.4501146
#> [5,] 0.4982628
orsf_vi_negate(fit)
#>    ph.ecog        age 
#>  0.2265581 -0.0412957
orsf_summarize_uni(object = fit, n_variables = 1)
#> 
#> -- ph.ecog (VI Rank: 1) -----------------------
#> 
#>        |---------------- risk ----------------|
#>  Value      Mean    Median    25th %    75th %
#>   -1.3 0.2740017 0.2493573 0.2267411 0.3259105
#>   0.06 0.3642472 0.3664885 0.3522197 0.3812756
#> 
#>  Predicted risk at time t = 268 for top 1 predictors

Created on 2022-11-02 by the reprex package (v2.0.1)

from aorsf.

bcjaeger avatar bcjaeger commented on August 14, 2024

Absolutely - that makes sense to me. I will make an update soon.

from aorsf.

hfrick avatar hfrick commented on August 14, 2024

Awesome, thank you! 🙌

from aorsf.

Related Issues (20)

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.