Close Menu
    Trending
    • What comes next for AI copyright lawsuits?
    • Why PDF Extraction Still Feels LikeHack
    • GenAI Will Fuel People’s Jobs, Not Replace Them. Here’s Why
    • Millions of websites to get ‘game-changing’ AI bot blocker
    • I Worked Through Labor, My Wedding and Burnout — For What?
    • Cloudflare will now block AI bots from crawling its clients’ websites by default
    • 🚗 Predicting Car Purchase Amounts with Neural Networks in Keras (with Code & Dataset) | by Smruti Ranjan Nayak | Jul, 2025
    • Futurwise: Unlock 25% Off Futurwise Today
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Machine Learning»Naive Bayes Explained | Medium
    Machine Learning

    Naive Bayes Explained | Medium

    Team_AIBS NewsBy Team_AIBS NewsFebruary 25, 2025No Comments2 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    1. What’s it?

    — A statistical technique for classifying based mostly on Bayes Theorem. Supervised Studying. It assumes independence between options.

    2. Why did we’d like that?

    — For simplicity, multi-class prediction issues and restricted coaching information are wanted.

    3. When to make use of it?

    — Restricted coaching information, multi-class classification, high-dimensional information, and real-time purposes.

    4. The place is it generally utilized?

    — Spam filtering, textual content classification, recommender methods.

    5. How one can apply it?

    • If crucial, convert textual content information into numerical options utilizing strategies like CountVectorizer, which tokenizes sentences and counts phrase frequency.
    • Create a Naive Bayes classifier utilizing MultinominalNB or GaussianNB, it relies upon
    • Match the coaching information utilizing match()
    • Make a prediction utilizing predict()
    • Efficiency metrics.

    6. Key phrases

    System:

    The Formula of Naive Bayes
    The System of Naive Bayes
    • Ck is the k-th class
    • x=(x1,…,xn)x=(x1,…,xn) is the characteristic vector
    • P(Ck∣x) is the posterior likelihood of sophistication Ck given x
    • P(Ck) is the prior likelihood of sophistication Ck
    • P(xi∣Ck) is the probability of characteristic xi given class Ck
    • P(x) is the proof (which might be ignored because it’s fixed for all courses)

    Numerical Instance:

    Suppose we wish to predict whether or not it’s going to rain based mostly on two options: temperature (Scorching or Cool) and humidity (Excessive or Regular). We’ve got a small coaching dataset:

    Naive Bayes Coaching Knowledge

    Step 1: Calculate prior chances
    P(Rain=Sure) = 3/5 = 0.6
    P(Rain=No) = 2/5 = 0.4

    Step 2: Calculate conditional chances
    P(Cool|Rain=Sure) = 1/3
    P(Cool|Rain=No) = 2/2 = 1
    P(Excessive|Rain=Sure) = 3/3 = 1
    P(Excessive|Rain=No) = 0/2 = 0

    Step 3: Apply Naive Bayes method
    P(Rain=Sure|Cool,Excessive) ∝ P(Rain=Sure) * P(Cool|Rain=Sure) * P(Excessive|Rain=Sure)
    = 0.6 * (1/3) * 1 = 0.2

    P(Rain=No|Cool,Excessive) ∝ P(Rain=No) * P(Cool|Rain=No) * P(Excessive|Rain=No)
    = 0.4 * 1 * 0 = 0

    Step 4: Normalize chances
    Whole = 0.2 + 0 = 0.2
    P(Rain=Sure|Cool,Excessive) = 0.2 / 0.2 = 1
    P(Rain=No|Cool,Excessive) = 0 / 0.2 = 0

    Due to this fact, the mannequin predicts that it’s going to rain with a likelihood of 100%.

    Code Clarification:

    Naive Bayes Model
    Naive Bayes Mannequin
    Plot
    Plot
    Output of Naive Bayes Model
    Output of Naive Bayes Mannequin

    The Questions Arose:

    • Bayes Theorem
    • CountVectorizer, vectorizers
    • NB’s

    References:



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleDriving the Future: Rivian’s Rise and Vision in the EV Industry
    Next Article Are friends electric? | MIT Technology Review
    Team_AIBS News
    • Website

    Related Posts

    Machine Learning

    Why PDF Extraction Still Feels LikeHack

    July 1, 2025
    Machine Learning

    🚗 Predicting Car Purchase Amounts with Neural Networks in Keras (with Code & Dataset) | by Smruti Ranjan Nayak | Jul, 2025

    July 1, 2025
    Machine Learning

    Reinforcement Learning in the Age of Modern AI | by @pramodchandrayan | Jul, 2025

    July 1, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    What comes next for AI copyright lawsuits?

    July 1, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    How Would I Learn to Code with ChatGPT if I Had to Start Again

    May 1, 2025

    Using LLamaIndex Workflow to Implement an Agent Handoff Feature Like OpenAI Swarm | by Peng Qian | Feb, 2025

    February 1, 2025

    CEOs Seek to Recalculate AI Journey amid Backlash, Study Finds

    January 22, 2025
    Our Picks

    What comes next for AI copyright lawsuits?

    July 1, 2025

    Why PDF Extraction Still Feels LikeHack

    July 1, 2025

    GenAI Will Fuel People’s Jobs, Not Replace Them. Here’s Why

    July 1, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.