locked
LDA example - how to serialize/deserialize RRS feed

  • Question

  • Hi.

    I am trying to extend the LDA example code, and would like to be able to persist the model it generates so I can read it in other programs.

    Is there an easy way to serialize/deserialize it?

    Thanks

    Ian

    Friday, April 26, 2013 2:45 AM

All replies

  • See if this post helps.
    Friday, April 26, 2013 3:13 PM
  • More recently, this section of the documentation seems to have been added:

    http://research.microsoft.com/en-us/um/cambridge/projects/infernet/docs/How%20to%20save%20distributions%20to%20disk.aspx

    Is this still the recommended way to serialize and deserialize distributions?

    Also, do you have any suggestions for serializing/deserializing VariableArrays and the ranges that are used to define a model? i.e., if one wanted to use a posterior distribution as the prior for a model in making predictions, what is the best way to load these VariableArrays and Ranges into a new model?

    • Edited by Andrew Mao Tuesday, December 9, 2014 9:29 PM
    Tuesday, December 9, 2014 7:33 PM
  • Yes, this is still the recommended way.  As explained in the linked post, you don't want to serialize the VariableArrays themselves, you want to serialize the inferred distributions, and then set them as observed values in the new model.
    Wednesday, December 10, 2014 12:06 PM
    Owner