Python, Machine Learning & Deep Learning in Finance | IE Financial Talks

Python, Machine Learning & Deep Learning in Finance

By Antonio Rivela

            IE Business School is pioneering the usage of technology in finance within the Fintech focus.  A fully fledged Python programming core course became mandatory in the Master in Finance in 2018 in order to leverage on technology applications such as machine learning and deep learning.


Python is an open source, interpreted programming language, with a large set of advantages of which we can highlight flexibility, simplicity (upon developing new codes), a focus on functionality, with a range of libraries and with a very rapid and simple learning curve when it is compared to other languages. This is because of its simple and visual syntax as well as having a huge community of users who share codes in online platforms such as Github (where we can find libraries such as Keras, NumPy, Panda, Theano etc.). Its application is large and widely used in data analysis, big data, machine learning, web programming or finance processes. Because of all this, Python’s popularity is growing both among individual users and companies.


The use of Python in finance is very broad. It is possible to develop programs for calculating and comparing return ratios, measuring the risk of a certain investment, optimizing and managing portfolios, capital asset pricing, forecasting stock pricing, option and future pricing, financial modelling etc.


Machine learning and deep learning are a set of algorithms for automatic learning by using layers in cascade (meaning that the previous layer is used as a starting point for the next one). As they are capable of modeling data and recognizing patterns, they can take decisions in an informed manner.  They are widely used in new technologies such as driverless cars where the vehicle is able to recognize traffic signals or pedestrians and, subsequently, base its behavior on the data and respond accordingly.


The use of a large amount of data, both numerical and visual or textual and with huge computational power, helps to make computer decisions more accurate. The greater the volume of data, the better the response will be, since this response is based on the continuous learning of the machine.


This technology is used in the field of finance for a variety of purposes such as the development of programs for granting credit, risk analysis, fraud prevention, and automatic trading.

Automatic trading: the algorithms are used to analyze historical data and market behavior in order to predict future movements and make the decision to buy or sell autonomously when opportunities arise.

Robo advisor: personal advisor based on machine learning algorithms that analyze a large amount of data to advise according to customer variables, such as risk tolerance, diversification as well as investment preference, and determine the optimal portfolio for the customer.

Fraud detection: the prevention of banking fraud needs very sophisticated solutions since it is necessary to analyze a large amount of data as well as to detect patterns and possible suspicious transactions.

And finally, this technology can be applied to chatbots and call centers: to improve the efficiency of financial institutions and can also improve customer service since it can be running 24/7.


There are certain libraries written in Python with the ability to perform these types of tasks ranging from basic regressions to the knowledge of complex neural networks, in which the deep learning is based.


One of the most important libraries is Keras. This library is modular, extensible and minimalistic and, therefore, easy to use. It is based on layers: in the first layer the input dimensions are established and Keras will automatically deduce the following layers. In the middle one the model is developed until the last layer that will give us the output. The model uses numeric libraries such as TensorFlow (which uses parallelism, i.e. it is capable of performing several calculations simultaneously and solving several problems in parallel, which increases the speed and efficiency in complex calculations allowing the task to be divided into independent parts), Theano (which evaluates, defines and optimizes mathematical expressions such as matrix-value) and PyTorch (which combines two features: tensor computation and deep neuronal  networks).


In conclusion, we can see how the application of machine learning and particularly deep learning are being applied to the field of finance and how more and more will be developed to improve and optimize decision making and to make businesses more efficient. At the same time, we have seen how the use of Python and the different libraries and packages can be very useful for the development of these new technologies.