Replies: 1 comment
-
|
Two notes about JSON for model output:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
OG-Core has been using
pklas the format for saving model outputs such asSS_vars.pkl,TPI_vars.pkl, andmodel_params.pkl.The binary file type makes is impossible to see diffs, is not human readable, and poses more security risks.
In addition, the custom
Specificationsclass object saved tomodel_params.pklis saved with CloudPickle and cannot be saved and opened in different version of Python and so is not a good file type for long-term storage or for sharing across users/platforms.What about using JSON for all model output?
SS_vars.pklare in a single dictionary with values that are scalars or Numpy arrays. This dictionary could easily be saved to JSON.SS_vars.pklare in a single dictionary with values that are scalars or Numpy arrays. This dictionary could easily be saved to JSON.model_params.pklare almost all data types that can be put into a JSON. The exception is if tax functions use themonoormono2Dtype.Should we move over to JSON? The issue with certain tax function types (that are rarely used at this point) could be solved by saving just those function to a pickle file in parameterizations of the model that use those functions.
cc @rickecon
Beta Was this translation helpful? Give feedback.
All reactions