Skip to main content

Enhanced Decision Tree

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Enhanced Decision Tree (EDT)

What is Enhanced Decision Tree

TODO

Install

There is two option to install EDT library: from PyPi (easy) or from source.

PyPi

Use simple command:

pip install edt

That's it

From source

TODO

Get started

Here some simple example to use EDT

Classical Decision Tree

Construct classical Decision Tree on syntatic dataset:

import endt

x1 = endt.ContinuumData([1.,1.,2.,2.], name="x1")
x2 = endt.ContinuumData([100.,200.,100.,200.], name="x2")
y = endt.ContinuumData([10.,20.,30.,40])

tree = endt.Tree()
tree.fit([x1, x2], y)
print(tree)

res = tree.predict(1,2)
print("predict y(1,2) =", res)

Simple Enhanced Decision Tree

Add LSQ of order 2 in previous code:

import endt

x1 = endt.ContinuumData([1.,1.,2.,2.], name="x1")
x2 = endt.ContinuumData([100.,200.,100.,200.], name="x2")
y = endt.ContinuumData([10.,20.,30.,40])

funcs = endt.func.create_lsq_functions([x1, x2], order=2)

tree = endt.Tree(lsq_funcs=funcs)
tree.fit([x1, x2], y)
print(tree)

res = tree.predict(1,2)
print("predict y(1,2) =", res)

EDT from CSV

Let our dataset save is in the CSV file data.csv, containing two collumn of feature parameters and third collumn of reults

Create EDT from CSV file:

import endt
import numpy as np

data = np.loadtxt("data.csv").T
x = list(map(endt.ContinuumData, data[:-1]))
y = endt.ContinuumData(data[-1])
for i, xi in enumerate(x, start=1):
    xi.name = f"x{i}" # set name x1, x2, x3... for every feature parameters
funcs = endt.func.create_lsq_functions(x, order=2)
tree = endt.Tree(lsq_funcs=funcs)
tree.fit(x, y)
print(tree)

res = tree.predict(1,2)
print("predict y(1,2) =", res)

Full documentation

Read full documentation https://nanoworld_ml.gitlab.io/enhanceddecisiontree/

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

endt-0.11.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.

endt-0.11.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file endt-0.11.1.tar.gz.

File metadata

  • Download URL: endt-0.11.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for endt-0.11.1.tar.gz
Algorithm Hash digest
SHA256 a4c32f46275749683f0042deeae0f959eb1581f5478744baed13dbabbd66ac01
MD5 c2f6d5424eb933045b6b726998807ccf
BLAKE2b-256 b3aaf60e692c5045b4c7baeaae28885568f802d89aef1b116a6ef4b3267a14d1

See more details on using hashes here.

File details

Details for the file endt-0.11.1-py3-none-any.whl.

File metadata

  • Download URL: endt-0.11.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for endt-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99f593034ee74cd7f380d1c03a5c02177d0bef3eb61f33a02c4c152fc4fb3233
MD5 6cb26133e8ac88965d1cf0de396f2b68
BLAKE2b-256 bbb2f6ee15977b852beb2040cf7a3f510b62c945f6f70ea90082b856b14606c7

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