Metadata-Version: 2.4
Name: fklearn
Version: 4.2.1
Summary: Functional machine learning
Author: Nubank
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/nubank/fklearn
Project-URL: Documentation, https://fklearn.readthedocs.io
Project-URL: Repository, https://github.com/nubank/fklearn
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: joblib<2,>=1.3.2
Requires-Dist: numpy<3,>=1.26.0
Requires-Dist: pandas<3,>=2.2.3
Requires-Dist: scikit-learn<1.8,>=1.5
Requires-Dist: statsmodels<1,>=0.14.0
Requires-Dist: toolz<1,>=0.12.0
Requires-Dist: tqdm<5,>=4.32.1
Provides-Extra: lgbm
Requires-Dist: lightgbm<5,>=4; extra == "lgbm"
Provides-Extra: xgboost
Requires-Dist: xgboost<3,>=2; extra == "xgboost"
Provides-Extra: catboost
Requires-Dist: catboost<2,>=1.2.2; extra == "catboost"
Provides-Extra: tools
Requires-Dist: shap<0.49,>=0.43; extra == "tools"
Requires-Dist: swifter<2,>=0.24; extra == "tools"
Provides-Extra: demos
Requires-Dist: matplotlib<4,>=3.0.2; extra == "demos"
Requires-Dist: scipy<2,>=1.2.1; extra == "demos"
Provides-Extra: docs
Requires-Dist: nbsphinx<1,>=0.4.2; extra == "docs"
Requires-Dist: Sphinx<6,>=5; extra == "docs"
Requires-Dist: sphinx-rtd-theme<1,>=0.4.3; extra == "docs"
Requires-Dist: jinja2<3; extra == "docs"
Requires-Dist: markupsafe==2.0.1; extra == "docs"
Provides-Extra: all-models
Requires-Dist: fklearn[catboost,lgbm,xgboost]; extra == "all-models"
Provides-Extra: all
Requires-Dist: fklearn[all_models,tools]; extra == "all"
Dynamic: license-file

# fklearn: Functional Machine Learning

![PyPI](https://img.shields.io/pypi/v/fklearn.svg?style=flat-square)
[![Documentation Status](https://readthedocs.org/projects/fklearn/badge/?version=latest)](https://fklearn.readthedocs.io/en/latest/?badge=latest)
[![Gitter](https://badges.gitter.im/fklearn-python/community.svg)](https://gitter.im/fklearn-python/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
![Tests](https://github.com/nubank/fklearn/actions/workflows/push.yaml/badge.svg?branch=master)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

**fklearn** uses functional programming principles to make it easier to solve real problems with Machine Learning.

The name is a reference to the widely known [scikit-learn](https://scikit-learn.org/stable/) library.

**fklearn Principles**

1. Validation should reflect real-life situations.
2. Production models should match validated models.
3. Models should be production-ready with few extra steps.
4. Reproducibility and in-depth analysis of model results should be easy to achieve.


[Documentation](https://fklearn.readthedocs.io/en/latest/) |
[Getting Started](https://fklearn.readthedocs.io/en/latest/getting_started.html) |
[API Docs](https://fklearn.readthedocs.io/en/latest/api/modules.html) |
[Contributing](https://fklearn.readthedocs.io/en/latest/contributing.html) |


## Installation

To install via pip:

```
pip install fklearn
```

To install with optional dependencies:

```
pip install fklearn[lgbm]       # LightGBM support
pip install fklearn[xgboost]    # XGBoost support
pip install fklearn[catboost]   # CatBoost support
pip install fklearn[all_models] # All model backends
pip install fklearn[all]        # All models + tools
```

## Development with UV

fklearn uses [uv](https://docs.astral.sh/uv/) for dependency management. `uv sync`
creates a virtual environment, installs all locked dependencies, and installs
fklearn itself in **editable mode** (the default for uv projects) so changes
under `src/` are picked up without reinstalling.

### Setup
```bash
uv sync                 # core deps + dev group
uv sync --all-extras    # also installs lgbm / xgboost / catboost / tools / demos / docs
```

The `dev` dependency group (pytest, ruff, mypy, hypothesis) is included by
default via `tool.uv.default-groups`, so `uv sync` alone is enough for most
development workflows.

### Running Tests
```bash
uv run pytest --cov=src/
```

### Linting
```bash
uv run ruff check src/ tests/
uv run ruff format src/ tests/
```

### Adding Dependencies
```bash
uv add <package-name>          # runtime dependency
uv add --dev <package-name>    # dev dependency
```

### Note for Nubank contributors

Regenerate the lockfile with `--default-index https://pypi.org/simple/`:

```bash
uv lock --default-index https://pypi.org/simple/
```

## License

[Apache License 2.0](LICENSE)
