Skip to main content

A custom implementation of the Naive Bayes Gaussian algorithm

Project description

A Custom Implementation of the Naive Bayes Gaussian Algorithm

Description

This package is an application of the Naive Bayes Gaussian algorithm that is commonly used to classify objects whose attributes are continuous data.

Please click here to read my brief introduction to Bayesian statistics and a use case of my custom implementation of the Naive Bayes Gaussian algorithm.

Dependencies

This package uses the following libraries.

  • Python 3.8
  • pandas
  • numpy
  • plotly

Installing and Executing program

  1. Pip install the package
    pip install NaiveBayesGauss
    
  2. Import the model
    from NaiveBayes import NaiveBayesGauss
    
  3. Instantiate the model
    model = NaiveBayesGauss()
    
  4. Fit the training data
    model.fit(X_train, Y_train)
    
  5. Use the fitted model to predict a class using a single observation of attributes
    model.predict(X_target.iloc[10], use_normalizer=True)
    
  6. Obtain the preceeding prediction's complete prediction probability values
    model.predict_prob
    
  7. Calculate the model's prediction accuracy on fitted data and plot a confusion matrix
    model.predict_accuracy(X_target, Y_target, user_normalizer=True, confusion_matrix=True)
    
  8. Calculate the model's prediction accuracy on fitted data and plot the results on a heat map
    model.plot_heatmap(X_train, Y_train, attributes['SepalLengthCm', 'PetalLengthCm'], predict_label='Iris-setosa', h=0.1)
    

Authors

Ilya Novak @NovakIlya

Version History

  • 0.1
    • Initial Release

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

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

NaiveBayesGauss-0.0.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

NaiveBayesGauss-0.0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file NaiveBayesGauss-0.0.1.tar.gz.

File metadata

  • Download URL: NaiveBayesGauss-0.0.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.2

File hashes

Hashes for NaiveBayesGauss-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d5c6d5ab77d2fb21232a274847d80f08294f62d4530bde188e481bb04f8f681d
MD5 971680788d12c163c77dfd4cd0bfc48d
BLAKE2b-256 15272265e7fe04295f065856293e3816dafa11bb70dc333afa6fcea91659e0bf

See more details on using hashes here.

File details

Details for the file NaiveBayesGauss-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: NaiveBayesGauss-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.2

File hashes

Hashes for NaiveBayesGauss-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a83b97236d927ef1b1cfc1b1035fbb7488b5795b61f27cbde0def57f35d5792d
MD5 f982847483ca4607759fe272436a0f88
BLAKE2b-256 e4953603d413aa380fe8787d32175b3292acdf96e1e70d933ad54fc5347e4551

See more details on using hashes here.

Supported by

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