title: How to unpickle a class that is linked with C,C++ and python in Java/Android?
body: <p>I am using a Machine learning and statistical based classifier called as EVM (Extreme value machine) using link <a href="https://pypi.org/project/EVM/" rel="nofollow noreferrer">https://pypi.org/project/EVM/</a>. I train the model in python and save it as pickle file with the below code.</p>
  <pre><code>import EVM
  import pickle
  mevm = EVM.MultipleEVM(tailsize=300, cover_threshold = 0.7, distance_multiplier = 0.7, distance_function = scipy.spatial.distance.euclidean)
  mevm.train([trainX[i] for i in list(trainX.keys())])
  
  #Save the trained model
  with open('model.pkl','wb') as f:
    pickle.dump(mevm,f)
  
  </code></pre>
  <p>I could easily load the same model in Python using same Pickle module. When I save, all the weights gets saved inside the pickle file and I could do the inference as below,</p>
  <pre><code>import pickle
  import EVM
  with open('model.pkl','rb') as b:
       mevm = pickle.load(b)
  print(&quot;Probability of given input&quot;, mevm.max_probabilities([embeds[i]]))
  </code></pre>
  <p>But I could not read the same pickle file in Android/Java (I want to use this saved model in my android application). When I check the EVM class, there is a C file and a C++ file which is connected using a '.pyx' file. All these 3 files are read using a python EVM (i.e. import EVM) class. Please refer to the below link for the files
  <a href="https://pypi.org/project/EVM/#files" rel="nofollow noreferrer">https://pypi.org/project/EVM/#files</a></p>
  <p>My questions are</p>
  <ol>
  <li>How can I read this saved model in Android/Java ?</li>
  <li>Since this is linked with C,C++ and python, will it be possible to read in Java ?</li>
  <li>Any other better method to save this, so that I can use it Andriod/Java ?</li>
  </ol>
  <p>Any leads are appreciated.</p>
  <p>Thanks in Advance :)</p>