Giter Site home page Giter Site logo

issue with survfit() about cyclops HOT 4 CLOSED

ohdsi avatar ohdsi commented on July 20, 2024
issue with survfit()

from cyclops.

Comments (4)

msuchard avatar msuchard commented on July 20, 2024

This is almost surely an int64 issue. I'll look into it. If you could provide a small code snippet that causes the error, that would be quite helpful.

from cyclops.

msuchard avatar msuchard commented on July 20, 2024

@jreps -- this following does cause an error (both in Cyclops with the first covariateId that I need to fix and in bit64 in representing the 2nd #). But, I think you are experiencing something different. Can you add to this code snippet?

test_that("Check int64 reductions", {
    set.seed(123)

    data <- simulateCyclopsData(nstrata = 1,
                                nrows = 1000,
                                ncovars = 5,
                                model="logistic")

    # using int64
    data$outcomes$rowId <- bit64::as.integer64(data$outcomes$rowId)
    data$covariates$rowId <- bit64::as.integer64(data$covariates$rowId)
    data$covariates$covariateId <- bit64::as.integer64(data$covariates$covariateId)
    data$covariates$covariateId[1] <- bit64::as.integer64( "9223372036854775807")
    data$covariates$covariateId[2] <- bit64::as.integer64("18446744073709551615")

    cyclopsData64 <- convertToCyclopsData(data$outcomes,data$covariates, modelType = "lr", addIntercept = TRUE)
    data$covariates$covariateId[1:3]
    summary(cyclopsData64)
})

from cyclops.

jreps avatar jreps commented on July 20, 2024

I think the summary() issue with your data example is the same as in the summary() issue with the fitted model I saw yesterday:

set.seed(123)
  
  data <- simulateCyclopsData(nstrata = 1,
                              nrows = 1000,
                              ncovars = 5,
                              model="logistic")
  
  # using int64
  data$outcomes$rowId <- bit64::as.integer64(data$outcomes$rowId)
  data$covariates$rowId <- bit64::as.integer64(data$covariates$rowId)
  data$covariates$covariateId <- bit64::as.integer64(data$covariates$covariateId)
  data$covariates$covariateId[1] <- bit64::as.integer64( "9223372036854775807")
  data$covariates$covariateId[2] <- bit64::as.integer64("18446744073709551615")
  
  cyclopsData64 <- convertToCyclopsData(data$outcomes,data$covariates, modelType = "lr", addIntercept = TRUE)
  data$covariates$covariateId[1:3]
  
  fit <- Cyclops::fitCyclopsModel(cyclopsData64, prior = createPrior("laplace", useCrossValidation = TRUE)) 
  
  meanLinearPredictor(fit) # seems to give the same error 

from cyclops.

msuchard avatar msuchard commented on July 20, 2024

This commit (develop branch) should fix the issue (and probably introduce many new ones):

cdf3aa5

from cyclops.

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.