Skip to main content

Constructing decision trees with genetic algorithm with a scikit-learn inspired API

Project description

forthebadge made-with-python

example workflow name codecov.io MIT license travis status

Genetic Tree

The main objective of the package is to allow creating decision trees that are better in some aspects than trees made by greedy algorithms.

The creation of trees is made by genetic algorithm. In order to achive as fast as possible evolution of trees the most time consuming components are wrtitten in Cython. Also there are implemented mechanisms for using old trees to create new ones without need to classify all observations from beggining (currently in developmnet). There is planned to allow multithreading evolution.

The created trees should have smaller sizes with comparable accuracy to the trees made by greedy algorithms.

Project is currently in development (before first version). The first working official version should be developed in the January 2021 (with documentation and installation by pip).

Installation

To download the latest official release of the package use a pip command below:

pip install genetic-tree

Usage

Example usage:

from genetic_tree import GeneticTree
from sklearn import datasets

iris = datasets.load_iris()       # get iris data

gt = GeneticTree()
gt.fit(iris.data, iris.target)
y_pred = gt.predict(iris.data)    # it is recommended to predict on another subset of data than training

The y_pred contains an array with classes predicted by the GeneticTree

License

The work is a banchelor thesis on Warsaw University of Technology. Commercial use forbidden.

High-level interface of package is inspired by sklearn (https://github.com/scikit-learn/scikit-learn). Especially there are methods like: fit(), predict(), predict_proba(), apply(), set_params(), check_X(), check_input() which are inspired and / or copied from sklearn.

A low-level interface is inspired by sklearn decision_tree. The structure of tree (tree/tree.pyx) and some utils (tree/_utils.pyx) were copied from sklearn tree (https://github.com/scikit-learn/scikit-learn/tree/master/sklearn/tree).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

genetic_tree-0.1.2-cp38-cp38-manylinux2010_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

genetic_tree-0.1.2-cp38-cp38-manylinux2010_i686.whl (2.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

genetic_tree-0.1.2-cp38-cp38-manylinux1_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.8

genetic_tree-0.1.2-cp38-cp38-manylinux1_i686.whl (2.8 MB view hashes)

Uploaded CPython 3.8

genetic_tree-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl (568.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

genetic_tree-0.1.2-cp37-cp37m-manylinux2010_x86_64.whl (2.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

genetic_tree-0.1.2-cp37-cp37m-manylinux2010_i686.whl (2.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

genetic_tree-0.1.2-cp37-cp37m-manylinux1_x86_64.whl (2.6 MB view hashes)

Uploaded CPython 3.7m

genetic_tree-0.1.2-cp37-cp37m-manylinux1_i686.whl (2.5 MB view hashes)

Uploaded CPython 3.7m

genetic_tree-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl (560.9 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

genetic_tree-0.1.2-cp36-cp36m-manylinux2010_x86_64.whl (2.6 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

genetic_tree-0.1.2-cp36-cp36m-manylinux2010_i686.whl (2.5 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

genetic_tree-0.1.2-cp36-cp36m-manylinux1_x86_64.whl (2.6 MB view hashes)

Uploaded CPython 3.6m

genetic_tree-0.1.2-cp36-cp36m-manylinux1_i686.whl (2.5 MB view hashes)

Uploaded CPython 3.6m

genetic_tree-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl (566.8 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page