Seems like what you need is simply to import python machine learning libraries to Blender. Blender has its own python, but you can enable importing machine learning libraries to Blender in two ways:
- Install these libraries on Blender's python, hopefully using pip.
- Make blender use the system's python (has to be the same Python version as the bundled python installed with Blender).
If you're not sure where to find Blender's bundled python, type this in Blender's interactive python console:
import sys
sys.path
This will show you all the included libraries available to scripts running in Blender, and among them Blender's python directory. Here's the output of this line on my machine:
['C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\addons_contrib', 'C:\\Users\\tfc64\\AppData\\Roaming\\Blender Foundation\\Blender\\2.78\\scripts\\addons', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\addons', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\startup', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\modules', 'C:\\Program Files\\Blender Foundation\\Blender\\python35.zip', 'C:\\Users\\tfc64\\Anaconda3\\Lib', 'C:\\Users\\tfc64\\Anaconda3\\DLLs', 'C:\\Program Files\\Blender Foundation\\Blender', 'C:\\Users\\tfc64\\Anaconda3', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\Sphinx-1.4.1-py3.5.egg', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\win32', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\Pythonwin', 'C:\\Users\\tfc64\\Anaconda3\\lib\\site-packages\\setuptools-23.0.0-py3.5.egg', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\freestyle\\modules', 'C:\\Program Files\\Blender Foundation\\Blender\\2.78\\scripts\\addons\\modules', 'C:\\Users\\tfc64\\AppData\\Roaming\\Blender Foundation\\Blender\\2.78\\scripts\\addons\\modules']