Skip to content

[FEATURE] Enable cross-version deserialization #315

@andrewherren

Description

@andrewherren

Is your feature request related to a problem? Please describe.

Successive versions of stochtree sometimes enhance BART / BCF model objects with new parameters or tracking terms, thus changing the format of the JSON objects to which stochtree serializes models. This means models fit under prior versions of stochtree cannot always (easily) be deserialized.

Describe the solution you'd like

The ideal solution is twofold:

  1. We include stochtree version metadata in JSON objects going forward
  2. Add logic to detect / estimate the version of stochtree under which a model was fit and work around missing terms / parameters / metadata

Describe alternatives you've considered

There aren't many obvious alternatives to the new feature described above, but there are workarounds. One could use stochtree's API for interacting with JSON objects to directly deserialize forest terms, parameters, etc... and obtain predictions / posterior summaries from those objects. This is not an ideal workflow for users who expect deserialization + prediction to work out of the box, but it should make for a sufficient workaround until this feature is added to stochtree.

Additional context

User reported deserialization issue after updating to 0.4.1, their previous version model was serialized without the following fields:

  • link and outcome in outcome_model
  • “rfx_model_spec” (user also noted that has_rfx was FALSE, so this should not matter)
  • multivariate_treatment
  • bart_propensity_model was also missing the two outcome_model parameters

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions