Reputation: 4045
I am trying to use the LIBSVM-software in LabVIEW. Luckily there already exist wrappers on GitHub. I don't want to train the model again each time, I open LabVIEW but I got stuck with my limited knowledge of writing more complex structures to files. The structure looks as follows
and contains integers, doubles, booleans, enums and arrays (1D) and an array of arrays... The size of the arrays may change.
What is a proper way to save and load such a cluster? Or do I have to unbundle everything and write it to an XML file?
Upvotes: 0
Views: 2439
Reputation: 2276
If the cluster isn't going to change, then you can simply wire it directly to a Write to Binary File and then read it back.
If you want it to be more readable, you could probably use the built in XML functions to flatten it to XML and save it and then unflatten back, but I'm not sure how cleanly that handles changes.
If you're willing to install things, then there are libraries which serialize arbitrary clusters to INI files, like the OpenG variant configuration VIs or the MGI read/write anything VIs and these are easy to use and survive changes, although they do have limitations with some data types, like classes. I believe there are also some JSON options.
Upvotes: 1