-1

I need to call sklearn function on matlab. I have heard that there are some problems in calling numpy function and sklearn is based on numpy.

Is there any guide about that?

Donbeo
  • 17,067
  • 37
  • 114
  • 188
  • A simple option would be to work in python instead of matlab ;) – eickenberg Apr 05 '14 at 21:53
  • More seriously, if you want to wrap python functions to be callable from your matlab code there are many ways to do it. What are the problems you have heard about? – eickenberg Apr 05 '14 at 21:57
  • I am forced to use matlab but the machine learning support of matlab is not very good and I really prefer to use python. This is why I am looking for some wrapper method. I need something of very stable. I have read a post which says that there are problem to import numpy in matlab. Any advices is welcome – Donbeo Apr 05 '14 at 22:12
  • I guess I don't understand what it means to 'import numpy in matlab'. Often what people do, size of the problem permitting, is to write data to a file in one environment, load and process it in the other, save the result and load it back in the first environment. This way both environments never interact directly. – eickenberg Apr 05 '14 at 22:19
  • I need to integrate the code in a production environment. I can not save data on a file every time. I need to call python function from matlab. Is this possible? – Donbeo Apr 05 '14 at 22:24

1 Answers1

1

For Python I see different solutions:

  • COM on Windows platforms. This requires to register an application, check if this is possible and allowed on the cluster.
  • XMLRPC or SOAP. You may need to use Java-Classes in Matlab, but as you already realised this is very simple. Verify that the cluster has a Java VM available, many run matlab without java.
  • You can embed python code into c/c++, which allows you to write mex functions which run c code: http://docs.python.org/2/extending/embedding.html
  • Create a .Net assembly using IronPython, matlab supports .net
Daniel
  • 36,610
  • 3
  • 36
  • 69