Skip to main content

hiddenbayes

hiddenbayes is a Python library implementing the Hidden Naive Bayes (HNB) model, designed to extend scikit-learn. It provides a simple and efficient way to classify data using a probabilistic approach while incorporating hidden states for better representation of dependencies between features.

Installation

You can install hiddenbayes via pip: pip install hiddenbayes

Yet, you can install it directly from the source: git clone https://github.com/C4RBON0/hiddenbayes.git cd hiddenbayes pip install .

Make sure you have 'numpy' and 'scikit-learn' installed before using hiddenbayes

Usage example

Below is a example demonstrating how to use HiddenNaiveBayes

import numpy as np
from hiddenbayes.hnb import HiddenNaiveBayes

# Sample dataset (binary features)
X_train = np.array([[1, 0, 1], [0, 1, 0], [1, 1, 1], [0, 0, 0]])
y_train = np.array([0, 1, 0, 1])

# Initialize and train the model
model = HiddenNaiveBayes(num_hidden_states=2)
model.fit(X_train, y_train)

# Sample test data
X_test = np.array([[1, 0, 0], [0, 1, 1]])
predictions = model.predict(X_test)

print("Predictions:", predictions)

Development Setup

git clone https://github.com/C4RBON0/hiddenbayes.git cd hiddenbayes python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate pip install -r requirements.txt

Run tests to ensure everything is working correctly

python -m unittest discover tests

Contributing

Contributions are welcome, to contribute:

1- Fork the repository 2- Create a feature branch (git checkout -b feature-branch) 3- Commit your changes (git commit -m "Add new feature") 4- Push to the branch (git push origin feature-branch) 5- Open a pull request.

License

This project is licensed under the BSD-3 License

If you use this library in research or production, please consider citing or acknowledging it in your work. Your support helps improve the project.

@misc{HiddenBayes,
  author = {Angel Cervera Ronda},
  title = {HiddenBayes: Hidden Naive Bayes classifier for Python},
  year = {2025},
  howpublished = {\url{https://github.com/C4RBON0/hiddenbayes}}
}

Metadata

Release files for hiddenbayes 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hiddenbayes 0.1.0
File Size Uploaded
hiddenbayes-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hiddenbayes 0.1.0
File Interpreter ABI Platform
hiddenbayes-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / hiddenbayes-0.1.0.tar.gz

Download URL hiddenbayes-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0f78dcdab9a47ba391996c6fe8bcef3d2cec2cd24e7f86c49ba152d7e3b3cf31
BLAKE2b-256 checksum
How to use checksums
e72c938fa83ba8289ab90215dbd85415dc407bec9db593de1477caf5f858ac20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release files / hiddenbayes-0.1.0-py3-none-any.whl

Download URL hiddenbayes-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b4cf21c06f7a6c09ff7cce670a4bcbfc0881dd19e90c3a9e441c05c8dc405ae
BLAKE2b-256 checksum
How to use checksums
04b7d9c3d11e2b9c9432b325c5ef5483f38182b591e34ae95b8518353b8496ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page