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 example.ipynb.

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.8.tar.gz (35.2 kB view hashes)

Uploaded Source

Built Distribution

hiclass-2.0.8-py3-none-any.whl (21.9 kB view hashes)

Uploaded Python 3

Supported by

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