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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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