Skip to main content

Implementação dos algoritmos de árvore de decisão ID3, C4.5 e CART do zero

Project description

Minhas Árvores

Implementação educacional dos algoritmos ID3, C4.5 e CART em Python.

Instalação

pip install numpy pandas scikit-learn

Uso

from minhas_arvores import ID3, C45, CART
import pandas as pd

dados = pd.DataFrame({
    'Tempo': ['Sol', 'Nublado', 'Chuva'],
    'Jogar': ['Não', 'Sim', 'Sim']
})

X = dados[['Tempo']]
y = dados['Jogar']

# Treinar
id3 = ID3()
id3.fit(X, y)

# Predizer
resultado = id3.predict({'Tempo': 'Sol'})
print(resultado)

Exemplo Completo

python exemplo_uso.py

Algoritmos

  • ID3: Ganho de informação, categóricos apenas
  • C4.5: Razão de ganho, suporta contínuos e missing values
  • CART: Gini index, divisões binárias

Licença

MIT

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

minhas_arvores-1.0.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

minhas_arvores-1.0.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file minhas_arvores-1.0.0.tar.gz.

File metadata

  • Download URL: minhas_arvores-1.0.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for minhas_arvores-1.0.0.tar.gz
Algorithm Hash digest
SHA256 383bf04e6d59bc335ff3013b7a4e2dd165c4e8573a123b58ce9ac5411a616051
MD5 2acd50e40faf17aafa8d0c274e68da59
BLAKE2b-256 507e30384c79e9a00ff141676fe5567dec151e5cef4757089f311d4c55bc7f30

See more details on using hashes here.

File details

Details for the file minhas_arvores-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: minhas_arvores-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for minhas_arvores-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 286d220414eee36dbf43f52210885d7f28a3bdbbfdf2479a6e9fe378832e812a
MD5 a16a2479b483472da6d0a01bde6004c8
BLAKE2b-256 37ec6fc575e2d10706d0c28903601c6a4daeb9f32b2e9dbbe11df355b95f77d0

See more details on using hashes here.

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