Skip to main content

A Hidden Naive Bayes library, it will give support to scikit-learn

Project description

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}}
}

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

hiddenbayes-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

hiddenbayes-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file hiddenbayes-0.1.0.tar.gz.

File metadata

  • Download URL: hiddenbayes-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for hiddenbayes-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f78dcdab9a47ba391996c6fe8bcef3d2cec2cd24e7f86c49ba152d7e3b3cf31
MD5 03f7e88cd00762713cd71dc929127678
BLAKE2b-256 e72c938fa83ba8289ab90215dbd85415dc407bec9db593de1477caf5f858ac20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hiddenbayes-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for hiddenbayes-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b4cf21c06f7a6c09ff7cce670a4bcbfc0881dd19e90c3a9e441c05c8dc405ae
MD5 ef944a61aaeceea51c42457c97b627c0
BLAKE2b-256 04b7d9c3d11e2b9c9432b325c5ef5483f38182b591e34ae95b8518353b8496ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page