Welcome to fasttrees
fasttrees
is a Python implementation of fast-and-frugal trees, which are a specialisation of decistion trees for binary-classification.
Install fasttrees View fasttrees on GitHub Open an Issue on GitHub
Install fasttrees
You can easily install fasttrees
via pip
.
pip install fasttrees
When to use fast-and-frugal trees
Fast-and-Frugal Trees tend to do well on real-world data prone to (human) error, as they disregard information that doesn’t seem very predictive of the outcome. A typical use case is in an operational setting where humans quickly have to take decisions. You could then fit a fast-and-frugal tree to the data in advance, and use the simple resulting tree to quickly make decisions.
Usage
from fasttrees import FastFrugalTreeClassifier
# Instantiate a fast-and-frugal tree classifier
fc = FastFrugalTreeClassifier()
# Fit on your data
fc.fit(X_train, y_train)
# View the fitted tree (this is especially useful if the predictions
# will be carried out by humans in practice)
fc.get_tree()
# Predict
preds = fc.predict(X_test)
# Score
fc.score(X_test, y_test)
About the project
fasttrees
is © 2019-2024 by Dominic Zijlstra and Stefan Bachhofner.
The implementation is inspired and based on on the R
package FFTrees, developed by Phillips, Neth, Woike and Grassmaier.
License
fasttrees
is diributed by an MIT license.