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
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 transformative_harmonization-0.2.2.tar.gz.
File metadata
- Download URL: transformative_harmonization-0.2.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cd3f06d238add73287eb98ad3eec5b2e2581ddb96ac071f4bf94e426cb67d4c
|
|
| MD5 |
00f69e0ce0ce0a556aaf73cf43c7c171
|
|
| BLAKE2b-256 |
6696a2f54ff39a26b2ca8ab132f1b49450a73e1c2b7d90444d9e840cf65713b1
|
File details
Details for the file transformative_harmonization-0.2.2-py3-none-any.whl.
File metadata
- Download URL: transformative_harmonization-0.2.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beb7d0cc10de3755da58798532d38b8c452ca476b4d99b9ad09d6de11e8ca451
|
|
| MD5 |
cae598c19fd53f9478b9dede3ee49908
|
|
| BLAKE2b-256 |
7f9a913c8d4ca00b85bcafea1b4a0583745f63640e91fceff9b3ca3586ddc379
|