Build and backtest a machine-learning trading strategy using pre-built financial data structures and labeling tools.
Apply feature engineering and clustering to market data before feeding it into a prediction model.
Use the library's cross-validation and bet-sizing modules to evaluate a quantitative investing idea.
Requires purchasing a paid Business or Enterprise license before you can use the library.
MlFinLab is a Python library built for people who work in finance and want to use machine learning as part of their trading or investing process. It covers the full pipeline of building a machine-learning-based trading strategy, from preparing raw market data into usable structures, to labeling that data, to training models, to measuring how well a strategy would have performed. The goal is to give quant researchers and portfolio managers a set of tested, documented tools so they do not have to rebuild common pieces from scratch. The library is organized into a set of modules, each covering a different stage of the process. These include data structures, labeling, sampling, feature engineering, models, clustering, cross-validation, hyper-parameter tuning, feature importance, bet sizing, synthetic data generation, network analysis, and measures of statistical dependence between variables. The README does not explain each module in depth, but documentation, example notebooks, and lecture videos are available through the Hudson and Thames website and YouTube channel. The public GitHub repository is described as existing mainly for users to raise bug reports, feature requests, and other issues. The library itself is a commercial product: it is licensed under an all-rights-reserved license, meaning you need to purchase access to use it. Two license tiers are listed, Business and Enterprise. Purchasers also get access to a private Slack community where the company's engineers and other users can answer questions. Hudson and Thames, the company behind the library, describes its mission as bringing advanced quantitative finance research into practical use. The library is influenced by academic work in financial machine learning, translating research techniques into reusable, tested code that practitioners can apply to real strategies.
← hudson-and-thames on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.