Skip to content

Large memory footprint of Cox-PH model #37

@davibarreira

Description

@davibarreira

Hey fellas, thanks a lot for this package. I've been using it recently, and I noticed that, for some reason, it's taking a huge toll in my memory. I have a dataframe with 20k rows. Once I load the dataframe, I have a 4gb of memory in use. After running the Cox-PH model, it grows to 11gb, and stays that way, even if I place the whole thing inside a function.

sdf = CSV.read("sdf.csv", DataFrame);
function coxphcoef(sdf)
    X = Matrix(sdf[!,Not(:duracao)])
    y = sdf[!,:duracao];
    y = EventTime.(y,[true for i in y]);
    @show cphmodel = coxph(X,y);
    return cphmodel.β
end
coxphcoef(sdf);

What is going on here?

BTW, I'm in Julia 1.7.2. Using:
DataFrames v1.3.2
Survival v0.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions