Speedy Python with Numba and Genetic Programming

Speedy Python with Numba and Genetic Programming


Speedy Python with Numba and Genetic Programming

A comment came in from highly active newsletter subscriber:

Python slow and inefficient”


You mention Cython in speeding up your code, you may like to consider for certain situations adding numba to your arsenal as well. Numba allows you to keep your python code in generic form and use a decorator to invoke a LLVM (JIT)compiler to compile the byte code run close to machine code times. http://ift.tt/2r9Jxzi


I use this often after profiling the python code to target bottlenecks, (http://ift.tt/2rIL1h7)

It can be used with multithread and also Numba Pro and CUDA with Nvidia GPUs. By profiling the code you can ascertain where the bottlenecks are in the code and where to target your efforts in speeding up code.



For comparison studies see http://ift.tt/1mlYpDM


(Another option for fast computation is to write a Fortran function directly ( yes I am of that vintage! J ), and use the f2py package to interface with the function.)


The other comment: you refer to the issue of the “market landscape always changing”, and you need a library of algorithms to cater for this.  I would add not only a library, but a “dynamic” library. One such approach would be to use Machine learning to generate new ideas constantly. Genetic Programs (GP) can generate trading ideas or systems from the data itself (more advanced applications will write the system code) , you may have a machine dedicated solely for this task. If you map your search space to a higher dimension you may discover patterns  that are exploitable and give you an edge. Being nimble counts.


I followed up with questions of:

What GP Python packages to use? Compatible with Machine Learning Python packages that this can work with? Any such examples for this use?

This story shall continue



via Quantlabs.Net http://ift.tt/1XIdEWE

May 22, 2017 at 05:21PM


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s