Skip to main content

Naive Algorithm Module Implemented in Python

Project description

NaivePy

Read the Docs   GitHub   PyPI - Python Version   PyPI - Status   PyPI - Format   GitHub last commit   GitHub Release Date   GitHub Repo stars

GitHub Repo stars

This Module Is No Longer Maintained

v1.1 is the last release.

Naive Bayes :

About Naive Bayes :

Naïve Bayes algorithm is a supervised learning algorithm, which is based on Bayes theorem and used for solving classification problems.
It is mainly used in text classification that includes a high-dimensional training dataset.
Naïve Bayes Classifier is one of the simple and most effective Classification algorithms which helps in building the fast machine learning models that can make quick predictions.
It is a probabilistic classifier, which means it predicts on the basis of the probability of an object.
Some popular examples of Naïve Bayes Algorithm are spam filtration, Sentimental analysis, and classifying articles.

Formula Of Naive Bayes :

Bayes' theorem is also known as Bayes' Rule or Bayes' law, which is used to determine the probability of a hypothesis with prior knowledge. It depends on the conditional probability. The formula for Bayes' theorem is given as: Naïve Bayes Classifier Algorithm Where,

$P(A|B)$ = ${P(B|A)P(A)} \over P(B)$

P(A|B) is Posterior probability: Probability of hypothesis A on the observed event B.

P(B|A) is Likelihood probability: Probability of the evidence given that the probability of a hypothesis is true.

P(A) is Prior Probability: Probability of hypothesis before observing the evidence.

P(B) is Marginal Probability: Probability of Evidence.

Documentation:

Read the Docs Here

Installation :

To Install the module

pip install naivepy

About Module:

Naivepy module is built using python and pandas. It is and machine learning algorithm. This Module can take the target column and classifies it.

Note : The Target Column must have 2 Types of values other wise MaxTargetColumnException will be occured.

Examples :

Code :

from naivepy import Naive

n=Naive(filename="data.csv",sample_list=["red","suv","domestic"],target_column="stolen")
print(n.getans)
print(n.getdata)
print(n.getlabel)

Output :

        Color    Type    Origin Stolen
   0     Red  Sports  Domestic    Yes
   1     Red  Sports  Domestic     No
   2     Red  Sports  Domestic    Yes
   3  Yellow  Sports  Domestic     No
   4  Yellow  Sports  Imported    Yes
   5  Yellow     SUV  Imported     No
   6  Yellow     SUV  Imported    Yes
   7  Yellow     SUV  Domestic     No
   8     Red     SUV  Imported     No
   9     Red  Sports  Imported    Yes
   No
   0.072

Author : Prathamesh Dhande

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

naivepy-1.1.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

naivepy-1.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file naivepy-1.1.tar.gz.

File metadata

  • Download URL: naivepy-1.1.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for naivepy-1.1.tar.gz
Algorithm Hash digest
SHA256 cbba948e4b8686ce65e16651f0b89e6fd8e3783b85d5afa18dd37b30d8230647
MD5 9901cbb5ecd0f77e336b126392a03441
BLAKE2b-256 5c1d9c207768dd616c95ceddc04dee76370e205eea82c189d571e895538da439

See more details on using hashes here.

File details

Details for the file naivepy-1.1-py3-none-any.whl.

File metadata

  • Download URL: naivepy-1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for naivepy-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f516ab7a35a16cc8e4cc2b1aa60a96dc2d68df931c4a0a521b582e389566a88b
MD5 f167a004867b77669daefbed87ab25b3
BLAKE2b-256 8ff4a5a2661e4523aa2c4c53c1c53104f9bad94dbe66f6d84229bfea5c94a595

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