Skip to main content

A Python library for Transformative Harmonization, a novel similarity metric

Project description

Transformative Harmonization A Python library for Transformative Harmonization, a novel mathematical operation designed by Zayn. This operation combines numbers, vectors, or matrices in a context-aware, harmonious manner, offering a new similarity metric for data science and machine learning applications. Features

Harmonization of numbers, vectors, and matrices with customizable context parameters. Optimized for machine learning tasks (clustering, classification, recommendation systems). Comprehensive mathematical properties (commutativity, continuity) and unit tests. Extensive documentation with practical examples. MIT licensed for open-source use.

Installation Install via pip: pip install transformative-harmonization

Published on PyPI: https://pypi.org/project/transformative-harmonization/

Quick Start Basic Harmonization (Numbers) from transformative_harmonization import TransformativeHarmonization

th = TransformativeHarmonization(context={'weight': 1.0, 'scale': 1.0}) result = th.harmonize(3, 4) print(result) # Output: ~3.50

Vector Harmonization (Machine Learning) import numpy as np from transformative_harmonization import VectorHarmonization

vh = VectorHarmonization(context={'weight': 1.0, 'scale': 1.0}) v1 = np.array([1, 0]) v2 = np.array([0, 1]) result = vh.harmonize(v1, v2) print(result) # Output: Harmonized vector

Custom Harmonization from transformative_harmonization import CustomHarmonization

def custom_harmony(a, b, context): return context['scale'] * (a + b) / 2 ch = CustomHarmonization(custom_harmony, context={'scale': 2.0}) result = ch.harmonize(3, 5) print(result) # Output: 8.0

Running Tests To run the unit tests: pip install numpy scikit-learn python -m unittest discover tests

Documentation Full documentation is available at Read the Docs. Mathematical Properties

Commutative: Yes (H(a, b) = H(b, a)). Associative: No (H(H(a, b), c) ≠ H(a, H(b, c))). Continuous: Yes for all inputs except a + b = 0. Contextual: Adjustable via weight and scale parameters.

Contributing Contributions are welcome! Please:

Fork the repository. Create

a feature branch.3. Submit a pull request with clear documentation and tests. See CONTRIBUTING.md for details. License This project is licensed under the MIT License. See the LICENSE file for details. Contact For questions or feedback, please open an issue on GitHub or contact Zayn.

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

transformative_harmonization-0.2.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

transformative_harmonization-0.2.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file transformative_harmonization-0.2.2.tar.gz.

File metadata

File hashes

Hashes for transformative_harmonization-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4cd3f06d238add73287eb98ad3eec5b2e2581ddb96ac071f4bf94e426cb67d4c
MD5 00f69e0ce0ce0a556aaf73cf43c7c171
BLAKE2b-256 6696a2f54ff39a26b2ca8ab132f1b49450a73e1c2b7d90444d9e840cf65713b1

See more details on using hashes here.

File details

Details for the file transformative_harmonization-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for transformative_harmonization-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 beb7d0cc10de3755da58798532d38b8c452ca476b4d99b9ad09d6de11e8ca451
MD5 cae598c19fd53f9478b9dede3ee49908
BLAKE2b-256 7f9a913c8d4ca00b85bcafea1b4a0583745f63640e91fceff9b3ca3586ddc379

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