Skip to main content

No project description provided

Project description

GATree

PyPI version GATree Documentation status Open issues Repository size License

About 📋

GATree is a Python library designed for implementing evolutionary decision trees using a genetic algorithm approach. The library provides functionalities for selection, mutation, and crossover operations within the decision tree structure, allowing users to evolve and optimise decision trees for various classification tasks. 🌲🧬

The library's core objective is to empower users in creating and fine-tuning decision trees through an evolutionary process, opening avenues for innovative approaches to classification problems. GATree enables the dynamic growth and adaptation of decision trees, offering a flexible and powerful tool for machine learning enthusiasts and practitioners. 🚀🌿

Installation 📦

pip

To install GATree using pip, run the following command:

pip install gatree

Usage 🚀

The following example demonstrates how to perform classification of the iris dataset using GATree. More examples can be found in the examples directory.

import pandas as pd
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from gatree.gatree import GATree

# Load the iris dataset
iris = load_iris()
X = pd.DataFrame(iris.data, columns=iris.feature_names)
y = pd.Series(iris.target, name='target')

# Split the dataset into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=123)

# Create and fit the GATree classifier
gatree = GATree(n_jobs=16, random_state=123)
gatree.fit(X=X_train, y=y_train, population_size=100, max_iter=100)

# Make predictions on the testing set
y_pred = gatree.predict(X_test)

# Evaluate the accuracy of the classifier
print(accuracy_score(y_test, y_pred))

License

This package is distributed under the MIT License. This license can be found online at http://www.opensource.org/licenses/MIT.

Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!

Project details


Download files

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

Source Distribution

gatree-0.1.4.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

gatree-0.1.4-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file gatree-0.1.4.tar.gz.

File metadata

  • Download URL: gatree-0.1.4.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.2 Windows/10

File hashes

Hashes for gatree-0.1.4.tar.gz
Algorithm Hash digest
SHA256 034bc9762ff0210694246373481e0a71ef4a951780f287e862921d3d58587af3
MD5 09977b0ee12e181908295ec579590bd8
BLAKE2b-256 d03e40023a7b84fd792cfb47fa8a47010bd475fd2b84535292fe3fce90314ac2

See more details on using hashes here.

File details

Details for the file gatree-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: gatree-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.2 Windows/10

File hashes

Hashes for gatree-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e019300b0175f07ce866ad0716e492e248b29f8044676fe692a2382c1ad4ce61
MD5 b11b681c931eb741c0e6d12fd69c5c3e
BLAKE2b-256 e1fdcb1d3d890ded94ead8747c3d6889c2d0283c5bd4620eadefe1e3af281113

See more details on using hashes here.

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