Skip to content

smaller memory footprint of models #2113

Open

Description

@jseabold

We currently carry around some data that might not be strictly necessary. E.g., orig_endog, orig_exog, etc. We probably shouldn't do this by default. We should also make the attached data instance the first-class citizen and have endog, exog, etc. only has properties of the models that point to the data attributes.

Activity

  1. added this to the 0.7 milestone on Dec 2, 2014
  2. josef-pkt commented on Dec 5, 2014

    @josef-pkt
    Member

    I'm not sure what you have in mind.
    In general we carry around references and don't copy the data, which means users can take advantage of this. What are the cases where orig_endog and orig_exog are separate arrays? Most likely in some cases where they are pandas Dataframes that are not float. ?
    patsy doesn't give us the original DataFrame, does it?

    Same for endog, exog. AFAICS, endog exog are references, and they are convenient being attached to the model.

    I think I prefer to keep data out of the user interface. That would be another layer to learn and keep track of, and it makes it more difficult to have without_data models. (BigOLS, ...)

  3. jseabold commented on Dec 5, 2014

    @jseabold
    MemberAuthor

    Anytime we have any missing data handling or pass a pandas object in to a
    model we carry around a reference to the original data which is different,
    which strikes me as unnecessary. We're actually using the original data
    internally in a few models, so that will need to be cleaned up.

    I also don't think there's ever any reason to have a user interact directly
    with the data object.

  4. josef-pkt commented on Dec 5, 2014

    @josef-pkt
    Member

    Ok, we might only need a few things, like the row labels (index) from the original data, and could throw away the rest.

    I haven't looked at MICE in a while and don't remember how the missing indices/values are stored.

    Related: I think we mentioned somewhere else that we could also drop the caching of some attributes. I don't think we need to store all the residuals in GLM. (But here also it's the choice of the user, if an attribute is never accessed it isn't cached, which is relevant for batch processing when we just want a few results or predictions.)

    On the other hand, we might need some "flags" and user options for lower memory. I'm thinking of attaching auxiliary regression results so they can be reused by the results. For example, GLM and RLM don't attach currently the last WLS regression which should be useful for diagnostic analysis.

  5. josef-pkt commented on Dec 18, 2014

    @josef-pkt
    Member

    I was just looking at the wrapper to see how row_labels work.

    It gets them from data.orig_exog or data.orig_endog. The index is not copied anytime before usage in wrap output, AFAICS. ModelData.rowlabels

  6. modified the milestones: 0.8, 0.7 on Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions