Estimators
All estimators live in the pytrees package and follow the scikit-learn
conventions: parameters are set in the constructor, fit returns the
estimator, fitted attributes end with an underscore, and the estimators can be
cloned, pickled and used inside Pipeline, GridSearchCV or
cross_val_score.
| Estimator | Task | Features | Search |
|---|---|---|---|
DL85Classifier | classification | binary | optimal, optionally anytime |
LGDTClassifier | classification | binary | greedy with a depth-2 lookahead |
ConTreeClassifier | classification | continuous | optimal, optionally anytime |
DL85Cluster | clustering | binary | optimal |
Some behaviour is shared by all of them:
- Labels.
ycan hold any labelsnp.uniqueaccepts (integers, strings, and so on).classes_lists them, andpredictreturns them. - Binary features. DL8.5, LGDT and DL85Cluster only accept 0 and 1 in
Xand raise aValueErrorotherwise, both infitand inpredict. Use aBinarizer, aKBinsDiscretizerwith one-hot encoding, or your own thresholds to prepare the data. - The fitted tree.
tree_is apytrees.tree.Treewith the same layout as scikit-learn’s.apply,decision_pathandto_dotwork on it for every estimator. - Search results.
train_error_is the training error of the tree,status_says why the search stopped, andstatistics_holds counters such as the search time (duration, in seconds) and the size of the cache.