Hierarchical Classification Library.
Project description
Hiclass - Hierarchical Classification Library
This library implements the three local classifier approaches described in [1].
Installation
HiClass and its dependencies can be easily installed with conda:
conda install -c conda-forge hiclass
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57a2aa43a7139d0e4c9057649c521c76cbf6358b0888df3f71c0cee59e166bc9
|
|
| MD5 |
82bf5a31491d2cb223449ff0e17b98fd
|
|
| BLAKE2b-256 |
d9e697a2f3c2d1ff890a61521c6b6acf1ca2cd9ecfbd718b4743489e2c7c4db4
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9240dc1d948efa15021d2365e9eb310b00a039b8e86639c13f57f805a2061752
|
|
| MD5 |
da9f9c89651f267b3a56b91838b82da4
|
|
| BLAKE2b-256 |
5f8a9bf7db875c554bed0a2095978ff2eb5aeb1132a0ac9ee79e8adf3af75c36
|