Answered step by step
Verified Expert Solution
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 actual automobile accidents in 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 GPSassisted reporting
Our goal here is to predict whether an accident just reported will involve an injury MAXSEVIR or or will not MAXSEVIR For this purpose, create a dummy variable called INJURY that takes the value yes if MAXSEVIR or and otherwise no
CLet us now return to the entire dataset. Partition the data into training and validation
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 wwwdataminingbook.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 PINJURY No SPDLIM
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started