Giter Club home page Giter Club logo

Comments (4)

havakv avatar havakv commented on August 23, 2024

Hi! Thank you for the feedback!
It's a little hart to debug this by only you explanation, so if you're still having problems, would it be possible to send me a short piece of code with some data that reproduce this bug? If you can't send me your data set, could you create a simple dataset that result in this bug? In that case I would be happy to take a look!

from pycox.

havakv avatar havakv commented on August 23, 2024

So, for completeness. The statement assert durations.shape[0] == surv.shape[1] == surv_idx.shape[0] == events.shape[0] only checks that the number of samples (individuals or want one would call it) in the the test set is the same in the durations, events and surv_idx vector, and that we have the same number of survival predictions surv.shape[1]. You correctly identified this problem @lucapalazzi when your surv object did not match the samples in the test set.

I'm still not quite sure what your problem with the time scale in the discrete models is. The statement "the time scale is correct because we have set model.duration_index to be the grid points", just mean that the the index in the surv object is set to represent points in time rather than the discretization index. This is, however needed to compute the concordance, so any bug (or unintuitive api) needs to be fixed.

from pycox.

lucapalazzi avatar lucapalazzi commented on August 23, 2024

Hi. I found the error this morning and it has nothing to do with any api, but it was my oversight.
In particular, the mismatch between saving the function result predict_surv_df(x) in a csv file and the subsequent loading in another script gave me problems. This step has canceled the column with the grid points, leaving only the indexes.

The error submitted did not occur with the continuous models since the indexes matched the grid points, but it did occur with the discrete ones. That's why by setting 50 grid points, in the csv file I found 491 rows with indexes in the range 0-490 and not in the range 0-1628.

I apologize for the haste in opening issues that turn out to be trivial problems, which can be solved by paying more attention.
Thank you for your time

from pycox.

havakv avatar havakv commented on August 23, 2024

I'm happy you figured it out, and it is not a problem that you opened an issue. Clearly the assert durations.shape[0] == surv.shape[1] == surv_idx.shape[0] == events.shape[0] needs to print an error message such that the user can better understand why it is failing. Opening issues helps with improving the API.

from pycox.

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.