Skip to main content

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

ncd_knn_classifier-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

ncd_knn_classifier-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for ncd_knn_classifier-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dec16eefda3178fd00640989f81ed8f83c7af31b32a927db284ccdde4d10665e
MD5 366ef09751bd56e34691511556789b51
BLAKE2b-256 ed4a5933b423727f8a05e932387215be362141e8efd15865a02565d409150b81

See more details on using hashes here.

File details

Details for the file ncd_knn_classifier-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ncd_knn_classifier-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02e9e2c98c5dd30fd17014f47025eea434d5eef52922b4b089ebc6943916f2b5
MD5 143c32cb7b24a4d139aa247334dd9480
BLAKE2b-256 8c342a48631ce7c1f23b67e02c01c14e236a1c33a5093e4fdcc3f81312e86550

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