Skip to main content

A collection of very decisive decision trees

Project description

Decisive Tree

PyPI Version Python Version License: MIT Build Status

A from-scratch Python implementation of the ID3, C4.5, and CART decision tree algorithms, created for educational purposes.

This project provides a clear and understandable look into the core mechanics of these foundational machine learning models, from the splitting criteria to the recursive tree-building process. It also includes a suite of from-scratch utilities for data preprocessing and model evaluation.

Key Features

  • ID3 Algorithm: Implements the classic algorithm using Information Gain, perfect for datasets with nominal features.
  • C4.5 Algorithm: An extension of ID3 using Gain Ratio to handle both nominal (multi-way split) and continuous features (binary split).
  • CART Algorithm: Implements Classification and Regression Trees using Gini Impurity (for classification) and Variance Reduction (for regression) with strictly binary splits for all feature types.
  • Utilities: Includes custom, understandable implementations of:
    • Data splitting and preprocessing (split_data, one_hot_encode, ordinal_encode).
    • Model evaluation (get_confusion_matrix, calculate_metrics, plot_confusion_matrix).
  • Tree Visualization: All models include a .plot() method for a simple console-based visualization of the resulting tree structure.

Installation

You can install decisive-tree directly from PyPI:

pip install decisive-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 Distribution

decisive_tree-0.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

decisive_tree-0.1.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file decisive_tree-0.1.1.tar.gz.

File metadata

  • Download URL: decisive_tree-0.1.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for decisive_tree-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a80a91715b8996925a71c0249a6dd4bd3b68c0a18f79509fc77d4e6f44298cb7
MD5 bbb37a71a94df4948a0d91af466f6057
BLAKE2b-256 dfffc0e170d6909167f5f5a1b8a94bd6c886ca9fa87fc4592527bc4dcdcf9396

See more details on using hashes here.

Provenance

The following attestation bundles were made for decisive_tree-0.1.1.tar.gz:

Publisher: publish.yml on mateushmd/decisive-tree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decisive_tree-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: decisive_tree-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for decisive_tree-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 519c87d9aa7280f13226d79f39958d4bf41727f6a1acf4c33563a9e399ed9936
MD5 12356eb0f2663d89e71fd5ad3ea50d91
BLAKE2b-256 a841dc5e35413ced175c61b5e28d6cdc31341b0069cdd969aa2aed4f9efd572b

See more details on using hashes here.

Provenance

The following attestation bundles were made for decisive_tree-0.1.1-py3-none-any.whl:

Publisher: publish.yml on mateushmd/decisive-tree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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