项目作者: schufa-innovationlab

项目描述 :
Implementation of model trees for regression and classification
高级语言: Python
项目地址: git://github.com/schufa-innovationlab/model-trees.git
创建时间: 2019-07-31T12:42:42Z
项目社区:https://github.com/schufa-innovationlab/model-trees

开源协议:Apache License 2.0

下载


Model Trees

This package defines model trees as scikit-learn compatible estimators.
These can be used for both classification and regression.

The model trees use the gradient-based split criterion from [1]

Installation

The modeltrees package can directly be installed from GitHub using pip:
```shell scrip
pip install https://github.com/schufa-innovationlab/model-trees/archive/master.zip

  1. Now you are ready to start, e.g. with our [introductory example](#introductory-example)
  2. ### Development Version
  3. The modeltrees package is still under development. You can install the current development version via
  4. ```shell scrip
  5. pip install https://github.com/schufa-innovationlab/model-trees/archive/dev.zip

Alternative ways

There might be reasons not to use pip with GitHub, e.g. because some
proxy does not allows to connect to GitHub, or pip is just not
your tool of choice (keep in mind: you can also use pip in a conda setup).

In that case you could:

  1. Clone the repository locally and use the local path instead of aboves
    GitHub path.
  2. You can just copy the modeltrees folder into your projects source root.
    In that case, you have to install the dependencies manually.

Usage

The package provides two estimator classes:
ModelTreeRegressor for regression and ModelTreeClassifier for classification.
Both provide default settings for the base estimators used in the leafs and can directly be used.

Introductory Example

  1. from modeltrees import ModelTreeRegressor
  2. import numpy as np
  3. X = np.random.randn(10000, 3)
  4. y = np.matmul(X, [[-1], [2], [1.5]]) + np.random.randn(10000, 1) * 0.2
  5. mt = ModelTreeRegressor()
  6. mt.fit(X,y)
  7. p = mt.predict([[1, 2, 3]])
  8. print(f"Prediction: {p}")

Further examples

There is an examples folder that contains further examples and evaluations.
See the corresponding readme for further details and a list of examples.

References

[1] Broelemann, K. and Kasneci, G.;
A Gradient-Based Split Criterion for Highly Accurate and Transparent Model Trees;
International Joint Conference on Artificial Intelligence (IJCAI) 2019; pdf

Bibtex



@inproceedings{Broelemann2019modeltrees, author = {Klaus Broelemann and Gjergji Kasneci}, title = {A Gradient-Based Split Criterion for Highly Accurate and Transparent Model Trees}, booktitle = {Proceedings of the 28th International Joint Conference on Artificial Intelligence, {IJCAI} 2019}, year = 2019 }