A kNN classifier based on NCD distance metric for text compression
Project description
NCDClassifier
A kNN classifier based on the Normalized Compression Distance (NCD) for text classification.
Installation
Install the package using pip:
pip install NCD_KNN_Classifier
Usage
Here's a basic example of how to use the classifier:
from NCD_KNN_Classifier import CompNCDClassifier
# Assuming you have train and test datasets prepared
classifier = CompNCDClassifier(
train_dataset=dataset['train'],
test_dataset=dataset['test'],
k=3,
compressor="gzip",
verbose=True
)
classifier.save_to_pickle("train_footprints.pkl")
metrics = classifier.evaluate()
print("Evaluation metrics:", metrics)
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
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 ncd_knn_classifier-0.1.0.tar.gz.
File metadata
- Download URL: ncd_knn_classifier-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dec16eefda3178fd00640989f81ed8f83c7af31b32a927db284ccdde4d10665e
|
|
| MD5 |
366ef09751bd56e34691511556789b51
|
|
| BLAKE2b-256 |
ed4a5933b423727f8a05e932387215be362141e8efd15865a02565d409150b81
|
File details
Details for the file ncd_knn_classifier-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ncd_knn_classifier-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02e9e2c98c5dd30fd17014f47025eea434d5eef52922b4b089ebc6943916f2b5
|
|
| MD5 |
143c32cb7b24a4d139aa247334dd9480
|
|
| BLAKE2b-256 |
8c342a48631ce7c1f23b67e02c01c14e236a1c33a5093e4fdcc3f81312e86550
|