Skip to main content

fasttrees

Packages and Releases PyPI - Version
Build Status Upload Python Package Python package pyling: workflow
Test Coverage codecov
Other Information Downloads PyPI - Python Version linting: pylint

A fast-and-frugal-tree classifier based on Python's scikit learn.

Fast-and-frugal trees are classification trees that are especially useful for making decisions under uncertainty. Due their simplicity and transparency they are very robust against noise and errors in data. They are one of the heuristics proposed by Gerd Gigerenzer in Fast and Frugal Heuristics in Medical Decision. This particular implementation is based on on the R package FFTrees, developed by Phillips, Neth, Woike and Grassmaier.

Install

You can install fasttrees using

pip install fasttrees

Quick first start

Below we provide a qick first start example with fast-and-frugal trees. We use the popular iris flower data set (also known as the Fisher's Iris data set), split it into a train and test data set, and fit a fast-and-frugal tree classifier on the training data set. Finally, we get the score on the test data set.

from sklearn import datasets, model_selection

from fasttrees import FastFrugalTreeClassifier


# Load data set
iris_dict = datasets.load_iris(as_frame=True)

# Load training data, preprocess it by transforming y into a binary classification problem, and
# split into train and test data set
X_iris, y_iris = iris_dict['data'], iris_dict['target']
y_iris = y_iris.apply(lambda entry: entry in [0, 1]).astype(bool)
X_train_iris, X_test_iris, y_train_iris, y_test_iris = model_selection.train_test_split(
    X_iris, y_iris, test_size=0.4, random_state=42)

# Fit and test fitted tree
fftc = FastFrugalTreeClassifier()
fftc.fit(X_train_iris, y_train_iris)
fftc.score(X_test_iris, y_test_iris)

Metadata

Release files for fasttrees 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fasttrees 1.3.1
File Size Uploaded Provenance Actions
fasttrees-1.3.1.tar.gz 10.5 kB Without provenance Details for fasttrees-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fasttrees 1.3.1
File Interpreter ABI Platform Actions
fasttrees-1.3.1-py3-none-any.whl Python 3 none any Details for fasttrees-1.3.1-py3-none-any.whl

Total release size: 19.9 kB

Release files / fasttrees-1.3.1.tar.gz

Download URL fasttrees-1.3.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
235c8523df1b522b69093461bfb30464991afae2881fd009d671eef4e94241c9
BLAKE2b-256 checksum
How to use checksums
02194ce74bb38cfe345d294745cdbbd7f50e18b7921093f091316482c9eb7a32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / fasttrees-1.3.1-py3-none-any.whl

Download URL fasttrees-1.3.1-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4fe519ccd5abedc4c16eb38c6565c4c55163d6b269fdbf3bcff5d016897db6c
BLAKE2b-256 checksum
How to use checksums
b27038cea42f99ad5c2e11d2efe8c7daf07449502a6629744b3338e80d3edaf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for fasttrees 1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page