Azure ML now supports Python scripts

Update 2/19/2015: Microsoft has now officially announced general availability of Azure Machine Learning and the fact that Python is now supported. You can find the announcement here.

As I was experimenting with Azure ML, I noticed a module called “Execute Python Script”.

image

I am pretty sure I haven’t seen this before and I also couldn't find any official announcement about it from Microsoft. (I also noticed a new “Deprecated” section, and under “Data Input and Output” I saw an “Enter Data” module which I can’t remember seeing before).

Anyway, this means you can now easily add Python scripts to Azure ML which is great because Python and R are the two most commonly used languages for machine learning in the industry, and both can now be used in the cloud with Azure ML.

Like with the Execute R Script module, the Python module accepts three inputs, two of which are for data sets.

image

The version of Python which Azure ML currently uses seems to be 2.7.7 and not the more recent 3.4. This is not necessarily a bad thing because versions 2 and 3 of Python are incompatible and not all of the libraries are available for Python 3. (I did not find a setting in Azure ML which allows you to select the version of Python you wish to use.)

The Python script runs in a sandbox which has 93 packages pre-installed, which I listed below. Pre-installed packages include scikit-learn – which is a set of machine learning algorithms - and  scikit-image, which includes powerful routines for image processing.

You can also use other packages via a zip file which you provide to the third input. The comments in the Python template script in Azure ML say:

If a zip file is connected to the third input port is connected, it is unzipped under ".\Script Bundle". This directory is added  to sys.path. Therefore, if your zip file contains a Python file mymodule.py you can import it using:
import mymodule

I have not tested the ability to load other packages with Python this way. When I tested the equivalent functionality for R a while ago, it did not work very smooth. Keep in mind that Azure ML is still in preview and some rough edges are to be expected.

Below is the list of packages currently pre-installed with Azure ML:

 

'argcomplete==0.6.7'

'astropy==0.3.2'

'atom==0.3.7'

'backports.ssl-match-hostname==3.4.0.2'

'beautifulsoup4==4.3.1'

'binstar==0.5.3'

'bitarray==0.8.1'

'blaze==0.5'

'blz==0.6.2'

'bokeh==0.4.4'

'boto==2.28.0'

'casuarius==1.1'

'cdecimal==2.3'

'chaco==4.4.1'

'colorama==0.2.7'

'conda-build==1.3.5'

'conda==3.5.5'

'configobj==5.0.5'

'cubes==0.10.2'

'cython==0.20.1'

'datashape==0.2'

'docutils==0.11'

'enable==4.3.0'

'enaml==0.9.1'

'flask==0.10.1'

'future==0.12.1'

'gevent-websocket==0.9.3'

'gevent==1.0.1'

'greenlet==0.4.2'

'grin==1.2.1'

'h5py==2.3.0'

'ipython==2.1.0'

'itsdangerous==0.24'

'jdcal==1.0'

'jinja2==2.7.2'

'kiwisolver==0.1.2'

'llvmpy==0.12.6'

'lxml==3.3.5'

'markupsafe==0.18'

'matplotlib==1.3.1'

'menuinst==1.0.3'

'mock==1.0.1'

'multipledispatch==0.4.3'

'networkx==1.8.1'

'nltk==2.0.4'

'nose==1.3.3'

'numba==0.13.2'

'numexpr==2.3.1'

'numpy==1.8.1'

'openpyxl==1.8.5'

'pandas==0.14.0'

'patsy==0.2.1'

'pep8==1.5.6'

'pil==1.1.7'

'ply==3.4'

'psutil==2.1.1'

'py==1.4.20'

'pycosat==0.6.1'

'pycparser==2.10'

'pycrypto==2.6.1'

'pyface==4.4.0'

'pyflakes==0.8.1'

'pygments==1.6'

'pyparsing==2.0.1'

'pyreadline==2.0'

'pytest==2.5.2'

'python-dateutil==1.5'

'pytz==2014.3'

'pywin32==218.4'

'pyyaml==3.11'

'pyzmq==14.3.1'

'requests==2.3.0'

'rope==0.9.4'

'runipy==0.1.0'

'scikit-image==0.10.0'

'scikit-learn==0.14.1'

'scipy==0.14.0'

'six==1.6.1'

'sphinx==1.2.2'

'spyder==2.3.0rc'

'sqlalchemy==0.9.4'

'statsmodels==0.5.0'

'sympy==0.7.5'

'tables==3.1.1'

'tornado==3.2.1'

'traits==4.4.0'

'traitsui==4.4.0'

'ujson==1.33'

'werkzeug==0.9.6'

'wsgiref==0.1.2'

'xlrd==0.9.3'

'xlsxwriter==0.5.5'

'xlwings==0.1.0'

'xlwt==0.7.5'