Member-only story
How to choose stocks to invest in with Python
Mixed-Integer Linear Programming as an Alternative Tool to solve the Stock Selection Problem
You plan to invest in several stocks in the coming 3 years, each with a different expected return for each dollar invested and a specific amount of investment, as shown in the table below (all in thousands of dollars). Given that the amount you can invest in stock purchases is limited each year, you want to decide which stocks to invest in each year so as to maximize the total returns.
When machine learning is not your choice
Everybody wants to receive the most returns with the least investment but not everybody takes the time to analyze the stocks because this is not an easy task. You decided to use your data science skills to help you with this problem but found it challenging to solve with machine learning techniques. Why is this the case?
While Machine Learning is great in learning from data and making predictions, it has a limitation in making the optimal decision. But with Python MIP (Mixed-Integer Linear Programming) tool, the stocks chosen for each year could be determined with ease. When your problems involve multiple constraints and allow for many possible solutions, only MIP has the power to find the optimal solution. You can find more information about MIP here. This blog will show you how to use this tool for your benefit.