Question: NEED A PYTHON CODE FOR THIS QUESTION PLEASE: Automobile Accidents. The file accidentsFull.csv contains information on 4 2 , 1 8 3 actual automobile accidents

NEED A PYTHON CODE FOR THIS QUESTION PLEASE:
Automobile Accidents. The file accidentsFull.csv contains information on 42,183 actual automobile accidents in 2001 in the United States that involved one of three levels of injury: NO INJURY, INJURY, or FATALITY. For each accident, additional information is recorded, such as day of week, weather conditions, and road type. A firm might be interested in developing a system for quickly classifying the severity of an accident based on initial reports and associated data in the system (some of which rely on GPS-assisted reporting).
Our goal here is to predict whether an accident just reported will involve an injury (MAX_SEV_IR =1 or 2) or will not (MAX_SEV_IR =0). For this purpose, create a dummy variable called INJURY that takes the value yes if MAX_SEV_IR =1 or 2, and otherwise no.
C.Let us now return to the entire dataset. Partition the data into training (60%) and validation (40%).
i. Assuming that no information or initial reports about the accident itself are available at the time of prediction (only location characteristics, weather con- ditions, etc.), which predictors can we include in the analysis? (Use the data descriptions page from www.dataminingbook.com.)
ii. Run a naive Bayes classifier on the complete training set with the relevant pre- dictors (and INJURY as the response). Note that all predictors are categorical. Show the confusion matrix.
iii. What is the overall error for the validations et?
iv. What is the percent improvement relative to the naive rule (using the validation
set)?
v. Examine the conditional probabilities in the pivot tables. Why do we get a probability of zero for P(INJURY = No | SPD_LIM =5)?

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!