The right way to load and use "pickle" files
I trained some model by Tensorflow and Keras and want to try it in backtesting, but I can't upload it to the environment.
I tried to upload a "pickle" file via the UI in the User Data section, but I got a message that says: "Binary/Executible Files Not Allowed".
I tried to create a new file via the UI with "pickle" extension and copy&paste the content of my file to it. This allowed me to create a file, but i can't find a way how to load it in to the enviroment.
Built-in python function "open" can't find this file. The function "service.read_file" return the content of the file as a string and i can't load it by "pickle" module.
I watched a few CloudQuants videos from Trevor Trinkino and there he says that he is using the "pickle" module to load a pretrained model to the enviroment.
Due to security restrictions, there is no way to upload anything to the site that is a binary file.
Internal users, like Trevor do not have those restrictions so I can appreciate the frustration.
But if you are using our system for machine learning and creating a pickle and you are stuck at the point of uploading a pickle, get in touch with us at email@example.com, we are very interested in what people are doing with our system and we want to help you achieve your goals.
Thank you. For now I managed to use the model by extracting weights from it and saving them in CSV. And then making predictions using numpy matrix multiplication in your enviroment. It's ok for the simple model that I'm trying to use right now.
Maybe someone will find this useful. Works only for simple dense model.
I just save weights by Keras Model's method in .h5 format:
Then extract the parameters from file:
Save it to CSV:
In the CloudQuant enviroment:
X shape: (n_features,1)