Close Menu
    Trending
    • Using Graph Databases to Model Patient Journeys and Clinical Relationships
    • Cuba’s Energy Crisis: A Systemic Breakdown
    • AI Startup TML From Ex-OpenAI Exec Mira Murati Pays $500,000
    • STOP Building Useless ML Projects – What Actually Works
    • Credit Risk Scoring for BNPL Customers at Bati Bank | by Sumeya sirmula | Jul, 2025
    • The New Career Crisis: AI Is Breaking the Entry-Level Path for Gen Z
    • Musk’s X appoints ‘king of virality’ in bid to boost growth
    • Why Entrepreneurs Should Stop Obsessing Over Growth
    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

    Credit Risk Scoring for BNPL Customers at Bati Bank | by Sumeya sirmula | Jul, 2025

    July 1, 2025
    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
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    Using Graph Databases to Model Patient Journeys and Clinical Relationships

    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

    News Bytes Podcast 20250224: Harnessing GPUs on the Internet, France Claims Fusion Record, Microsoft’s Quantum Chip

    February 24, 2025

    Small Business Administration: Surging Application Approvals

    April 24, 2025

    Landing your First Machine Learning Job: Startup vs Big Tech vs Academia

    June 4, 2025
    Our Picks

    Using Graph Databases to Model Patient Journeys and Clinical Relationships

    July 1, 2025

    Cuba’s Energy Crisis: A Systemic Breakdown

    July 1, 2025

    AI Startup TML From Ex-OpenAI Exec Mira Murati Pays $500,000

    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.