Skip to main content

Hierarchical Classification Library.

Project description

Hiclass - Hierarchical Classification Library

pipeline status coverage report Documentation Status

This library implements the three local classifier approaches described in [1].

Installation

Install with conda

HiClass and its dependencies can be easily installed with conda:

conda install -c conda-forge hiclass

Install with pip

Alternatively, HiClass and its dependencies can also be installed with pip:

pip install hiclass

Lastly, pipenv can also be used to install HiClass and its dependencies. In order to use this, first install it via:

pip install pipenv

Afterwards, you can create an environment and install the dependencies via (for dev dependencies, add --dev)

pipenv install

To activate the environment, run:

pipenv shell

For more information, take a look at the pipenv documentation.

If you do not wish to use pipenv, you can find the requirements in Pipfile under packages and dev-packages.

Usage

An example usage can be found below. For a more thorough example, see our interactive notebook. The full API documentation is available on Read the Docs.

from hiclass import LocalClassifierPerNode
from sklearn.ensemble import RandomForestClassifier

# define data
X_train, X_test = get_some_train_data()  # (n, num_features)
Y_train = get_some_labels()  # (n, num_largest_hierarchy)
# Use random forest classifiers for every node and run a classification
rf = RandomForestClassifier()
lcpn = LocalClassifierPerNode(local_classifier=rf)
lcpn.fit(X_train, Y_train)
predictions = lcpn.predict(X_test)

References

[1] Silla, C.N. and Freitas, A.A. (2011). A survey of hierarchical classification across different application domains. Data Mining and Knowledge Discovery, 22(1), pp.31-72.

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

hiclass-2.0.9.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

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

hiclass-2.0.9-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file hiclass-2.0.9.tar.gz.

File metadata

  • Download URL: hiclass-2.0.9.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for hiclass-2.0.9.tar.gz
Algorithm Hash digest
SHA256 57a2aa43a7139d0e4c9057649c521c76cbf6358b0888df3f71c0cee59e166bc9
MD5 82bf5a31491d2cb223449ff0e17b98fd
BLAKE2b-256 d9e697a2f3c2d1ff890a61521c6b6acf1ca2cd9ecfbd718b4743489e2c7c4db4

See more details on using hashes here.

File details

Details for the file hiclass-2.0.9-py3-none-any.whl.

File metadata

  • Download URL: hiclass-2.0.9-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for hiclass-2.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9240dc1d948efa15021d2365e9eb310b00a039b8e86639c13f57f805a2061752
MD5 da9f9c89651f267b3a56b91838b82da4
BLAKE2b-256 5f8a9bf7db875c554bed0a2095978ff2eb5aeb1132a0ac9ee79e8adf3af75c36

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