Naive Bayes

A Supervised Learning Algorithm for Classification

  • Chapter
  • First Online:
Thinking Data Science

Part of the book series: The Springer Series in Applied Machine Learning ((SSAML))

Abstract

When you want to make quick predictions on a high-dimensional dataset, you use Naive Bayes. This is one of the most efficient algorithms for classification and probably the simplest. When you have several thousand data points and many features in your dataset, it trains quickly to help you get predictions in real time. It thus helps in building the fast machine learning models to make quick predictions. It is also easy to build. The algorithm is based upon Bayes’ theorem. I have presented a detailed computation on how to compute the various probability terms of Bayes’ law, so that you understand how the algorithm works. I also discuss the various advantages and disadvantages of the algorithm where it can be applied and where it cannot be. Finally, I will give you a few techniques for improving its performance. The sklearn library provides several implementations of the algorithm based on the Naive Bayes types—such as Multinomial, Bernoulli, and so on. You will learn these various types. Last, I discuss how to fit the model on huge datasets, followed by a complete classification example on a large text corpus.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now
Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info
Hardcover Book
USD 69.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Sarang, P. (2023). Naive Bayes. In: Thinking Data Science. The Springer Series in Applied Machine Learning. Springer, Cham. https://doi.org/10.1007/978-3-031-02363-7_7

Download citation

Publish with us

Policies and ethics

Navigation