GithubHelp home page GithubHelp logo

elenasm7 / dsc-2-21-09-bayes-theorem-lab-nyc-ds-career-012819 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-students/dsc-2-21-09-bayes-theorem-lab-nyc-ds-career-012819

0.0 1.0 0.0 28 KB

License: Other

Jupyter Notebook 100.00%

dsc-2-21-09-bayes-theorem-lab-nyc-ds-career-012819's Introduction

Bayes' Theorem - Lab

Introduction

In this lab, we shall try to put some of the formulas to practice that we came across with in the previous lesson.

Objectives

  • Understand and describe the Bayesian theorem from conditional probabilities
  • Describe the roles of Prior, Likehood and Posterior components of Bayes Theorem
  • Understand and perform simple applications of Bayes Theorem for sensitivity and specificity

Exercise 1

If a single card is drawn from a standard deck of playing cards, What is the probability of seeing a king ?

# Your solution
0.07692307692307693

If evidence is provided (for instance, someone looks at the card) that the single card is a face card, what would be the posterior probability according to Bayes theorem?

# Your Solution
0.3333333333333333

Exercise 2

1. A couple has two children, the older of which is a boy. What is the probability that they have two boys?

2. A couple has two children, one of which is a boy. What is the probability that they have two boys?

# Explain events as:
# A = both children are boys
# B = older child is a boy 
# C = One of the children is a boy 
# Part 1
# Your solution
0.5
# Part 2 
# Your solution
0.3333333333333333

Exercise 3 - Bayesian Disease Diagnosis

Visit this link for an insight into Bayesian Disease Daignosis

A disease test is advertised as being 99% accurate

  • If a patient has the disease,they will test positive 99% of the time.

  • If you don't have the disease, they will test negative 99% of the time.

  • 1% of all people have this disease

Now a patient tests positive, what is the probability that you actually have the disease?

# Your solution
0.5

Summary

In this lab, we saw a few simple examples of Bayesian logic and how we can add prior information to our calculation, in order to update our beliefs about the certain events. Bayesian logic works in numerous ways and it is not within the scope of this section to give you a deep dive in complex Bayesian problems. You are advised to re-visit the provided links when you have a better understanding of Bayesian inference.

dsc-2-21-09-bayes-theorem-lab-nyc-ds-career-012819's People

Contributors

shakeelraja avatar loredirick avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.