Multi-target Random Forest implementation that can mix both classification and regression tasks.
Project description
morfist: mixed-output-rf
Multi-target Random Forest implementation that can mix both classification and regression tasks.
Morfist implements the Random Forest algorithm (Breiman, 2001) with support for mixed-task multi-task learning, i.e., it is possible to train the model on any number of classification tasks and regression tasks, simultaneously. Morfist's mixed multi-task learning implementation follows that proposed by Linusson (2013).
- Breiman, L. (2001). Random forests. Machine learning, 45(1), 5-32.
- Linusson, H. (2013). Multi-output random forests.
Installation
With pip:
pip install decision-tree-morfist
With conda:
conda install -c systemallica decision-tree-morfist
Usage
Initialising the model
- Similarly to a scikit-learn RandomForestClassifier, a MixedRandomForest can be initialised in this way:
from morfist import MixedRandomForest
mrf = MixedRandomForest(
n_estimators=n_trees,
min_samples_leaf=1,
classification_targets=[0]
)
For more info on the possible parameters, visit the documentation.
Training the model
- Once the model is initialised, it can be fitted like this:
Where X are the training examples and Y are their respective labels(if they are categorical) or values(if they are numerical)mrf.fit(X, y)
Prediction
- The model can be now used to predict new instances.
- Class/value:
mrf.predict(x)
- Probability:
mrf.predict_proba(x)
TODO:
- Speed up the learning algorithm implementation (morfist is currently much slower than the Random Forest implementation available in scikit-learn)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for decision-tree-morfist-0.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc9a6e0a43dd109534d18ced5dcc083628a5ccf3b05a049fe1e6595756eafbbc |
|
MD5 | 41c2542b4336b85ef49fa5ca5756af94 |
|
BLAKE2b-256 | 0bf1900d9b4724411900d3e5769b7c0caf8cf984f52683455c7656fcec226b66 |
Close
Hashes for decision_tree_morfist-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f50240eaf4966c3df6b28737a2f05d10123a7feb3f6424d6029e08f07489f619 |
|
MD5 | e16f842ffd73fe44092f1144d688a131 |
|
BLAKE2b-256 | 5c8b457a0b21ea33793f3c306854b82bbef268b74f13682c4e23d972cfd37f86 |