JuliaSurv / NetSurvival.jl

A pure-Julia take on standard net survival routines
https://juliasurv.github.io/NetSurvival.jl/
MIT License
6 stars 0 forks source link

[Internals] Few simplifications #34

Closed lrnv closed 2 months ago

lrnv commented 2 months ago

Hey I tried to do a bit of simplifications of the fit() code, I hope its more readable like that.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 96.15385% with 1 lines in your changes are missing coverage. Please review.

:exclamation: No coverage uploaded for pull request base (main@647aa41). Click here to learn what that means.

:exclamation: Current head f9f7309 differs from pull request most recent head 7a8367f. Consider uploading reports for the commit 7a8367f to get more accurate results

Files Patch % Lines
src/NPNSEstimator.jl 94.44% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #34 +/- ## ======================================= Coverage ? 91.34% ======================================= Files ? 8 Lines ? 208 Branches ? 0 ======================================= Hits ? 190 Misses ? 18 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lrnv commented 2 months ago

@rimhajal This simplifies the code but also changes the structure of the output of the pohar perme fitting when there are covariates, in particular when there is several covariates.

Maybe you could tell me what you think of the output of :

f1 = fit(PoharPerme, @formula(Surv(time,status)~sex), colrec, frpop)
f2 = fit(PoharPerme, @formula(Surv(time,status)~(sex+stage)), colrec, frpop)

Edit: Wait a bit I'm trying other output formats, I will ping you when i am done

rimhajal commented 2 months ago

that way people can tell what dataframe refers to which group, this is good!

rimhajal commented 2 months ago

julia> x.age 0x0000000000000002

julia> x.keys 16-element Vector{@NamedTuple{sex::Symbol, stage::Int64}}:

undef

undef

(sex = :male, stage = 1)
(sex = :female, stage = 3)
(sex = :female, stage = 99)
(sex = :male, stage = 99)

undef

undef

undef

(sex = :male, stage = 2)
(sex = :male, stage = 3)
(sex = :female, stage = 1)

undef

undef

undef

(sex = :female, stage = 2)

there are some weird outputs though

lrnv commented 2 months ago

@rimhajal Now the docs are adapted so this should also be good to go.