fklearn is Nubank’s open-source machine learning library built around functional programming principles. Instead of the mutable, stateful pipelines common in ML code, fklearn treats model building as composing pure functions – called learners – that take data in and return transformed data, predictions and logs, making experiments reproducible and easy to test. It is an open-source project on GitHub with around 1,600 stars, still maintained with updates in 2026.
The library grew out of production ML work at Nubank, one of the world’s largest digital banks, where auditability and reproducibility matter as much as accuracy. Each fklearn learner is a function with a clear contract, and learners chain into pipelines for feature engineering, training, calibration and evaluation. Because nothing hides in object state, a whole experiment can be serialized, versioned and re-run exactly. The library integrates with pandas and scikit-learn-style models and includes utilities for validation strategies that respect time, a common pitfall in financial ML.
fklearn is free and open source under the Apache 2.0 license.
Data scientists and ML engineers who want cleaner, testable, reproducible modeling code, especially in regulated or finance settings.
Because every fklearn learner is a pure function, the library makes a habit of logging exactly what happened to the data at each step, which auditors at a bank genuinely need. Nubank released it after using the approach internally for credit and risk models, and its documentation leans into worked examples – predicting churn, validating on time-based splits – rather than API references alone, so new users learn the functional style by doing.