Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions