A python framework simplifying the representation of deep domain classification hierarchies
Project description
multilevel_py
Multilevel_py is a library that simplifies the construction of classification hierarchies over more than two levels. The framework depends on python3 only and implements a “deep instantiation” mechanism using pythons metaprogramming facilities. In academia the addressed topic is also discussed under the term “Multilevel (Meta-) Modelling”. Since there is no corresponding framework in the python community until this point, multilevel_py was built to fill this gap.
Installing
Install and update using pip:
pip install multilevel_py
A Simple Example
The following code constructs a classification structure that spans three levels.
from multilevel_py.constraints import is_int_constraint, is_str_constraint
from multilevel_py.core import create_clabject_prop, Clabject
Breed = Clabject(name="Breed")
yearReg = create_clabject_prop(n="yearReg", t=1, f=0, i_f=True, c=[is_int_constraint])
age = create_clabject_prop(n="age", t=2, f=0, i_f=True, c=[is_int_constraint])
Breed.define_props([yearReg, age])
Collie = Breed(name="Collie", init_props={"yearReg": 1888})
lassie = Collie(name="Lassie", init_props={"age": 7}, declare_as_instance=True)
Visualisation
Using the viz module (requires installation of pygraphviz) the following graph can be rendered for the previous example:
Links
Github Repository: https://github.com/dataPuzzler/multilevel_py
Documentation: https://multilevel-py.readthedocs.io/en/latest/
Releases: https://pypi.org/project/multilevel-py/#description
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for multilevel_py-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10409691ece48859d03a344e217a60a79535975c197481242854fb613a17157d |
|
MD5 | edbfc4e8b745d93f8024f2e0da1b74c4 |
|
BLAKE2b-256 | 30c1ddccabdf9bcea655b8a82b045637842da4cb778efab6f92137e0c6754c8f |