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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3699b44ae541c6209817a63c4066eacb9b3833e171d6d6c8236bd44679b9fc95 |
|
MD5 | f74a62b507494c289195381bd83ef3c5 |
|
BLAKE2b-256 | 19af47d67c19bf22b8bb8acccde6ba5e747cecbf2ce2220798d78bdcfd4838ab |
Close
Hashes for decision_tree_morfist-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e77a0b9d762d91daa82acfa8073a887d21d5b16d9600b6efac1877b3535874c5 |
|
MD5 | ba71f3699d696955dadc5c962c8a7377 |
|
BLAKE2b-256 | 5cf8a1a78ee925f5708ebd10cfd9d5e908a1361d4cb57c9ff38c3306ec1eee23 |