Machine learning has become an increasingly popular technique in quantitative finance and factor investing. With open source machine learning libraries and free online code repositories like Github, investors can now access various machine learning algorithms to create predictive factors and build systematic investment strategies. In this article, we will look at 4 useful Github repositories that provide free machine learning examples for factor investing strategies.

Use machine learning to find factors related to stock returns
This Github repository by Quantopian user Delaney Mackenzie implements 5 machine learning algorithms to find predictive signals in stock market data. The algorithms explored include linear regression, random forest, XGBoost, neural networks, and transfer learning. Each notebook loads financial data from Quandl and uses scikit-learn to train models. The model performances are evaluated and the feature importances are analyzed. This is a good starter resource to apply sklearn for stock prediction.
Build a long-short portfolio using machine learning factors
This repository by Harvard student Siavash Kazemian presents a long-short portfolio construction process using machine learning. It focuses on creating alpha factors with XGBoost using fundamental and alternative data. The factors are combined into a multiple regression model. Then portfolio optimization and backtesting are performed to create a long-short strategy. This demonstrates a complete machine learning workflow for quant equity investing.
Deep learning for stock price prediction
This repository by Alex Olishevski implements a LSTM neural network model for predicting stock returns. It uses Keras with Tensorflow backend to train the deep learning model. The notebook loads Apple stock data and designs/trains the LSTM model. Different model architectures and hyperparameters are tested. This provides a simple example of applying deep learning for financial time series forecasting.
Machine learning algorithms for trading strategies
This repository by Jack Han provides a collection of machine learning algorithms for trading strategies, including linear regression, random forest, SVM, KNN, and neural networks. It uses sklearn and Keras for model implementation. The notebooks load sample trading datasets, preprocess data, train models, and evaluate strategy performance. The code examples allow quants to quickly get started with machine learning for algorithmic trading.
In summary, these 4 Github repositories offer useful free resources for investors to learn machine learning techniques and apply them for factor investing strategies. The examples cover major algorithms like regression, random forest, XGBoost, and neural networks. Investors can leverage these open source codes to identify predictive signals, construct long-short portfolios, forecast prices, and develop trading systems.