Question: PYTHON 2.7 PLEASE! CS511-Prog4.pdf Probabiity is a number that indicates the likelihcod of some outcome occurring, where each outcome comes from set called the sample

PYTHON 2.7 PLEASE!

PYTHON 2.7 PLEASE! CS511-Prog4.pdf Probabiity is a number that indicates the likelihcod

of some outcome occurring, where each outcome comes from set called thesample space, denoted by ?. Probabities are used in situations where there

CS511-Prog4.pdf Probabiity is a number that indicates the likelihcod of some outcome occurring, where each outcome comes from set called the sample space, denoted by ?. Probabities are used in situations where there is uncertainty in data. cither due to a lack of sufficient data or scme inherent randomness assodated with the data. Fonmally, probablility of each outcome x a value, p(x), that satisfies the following properties: 1. Vx E(p(x) E [0,1D each probability value has to be between zero and onel (Sum of al probabilities needs to be one) A set of outcomes defines an event. The probabiity of an event F is defined as PIE)- p(r) In many appications, it is necessary to estimate probabilities from dsta. If the data contains nominal (i.e. categoricall values, we can estimate the probability of a particle value occurring in the data by counting the number of instances in which the value occurs. In particular, assume the data consists oNinsiances, which of which is associated with a fixed number of feature values. Then the probability of a particular feature i having a particular value x can he computed as instances with featurer) We can also compute the conditional probabiity of a particular feature value, given some other features values as #(instances with feuture.-x1nd feature,-/) P(featurexlfeature-f)- aGeature- Note that the denominator is assumed to be non-zero. Such estimates can then be used for various data anahysis pplications, such as madeling cr machine learning. You are to create a program in Python that performs the following: 1. Asks the user for the number of cars (ie data instances) 2. For each car, asks the user to enter the folowing fields: make, model, type (coupe, sedan, SUV), rating (A C, D. or F). Save the teature values tor each car in a DataFrame object. 3 Displays the resulting DataFrame Computes the probability of each rating and outputs to the screen, For each type t, computes the conditional probability of that type, given each of the ratings s. P(type rating r) &. Displays the conditional probabilities to the screen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!