Automobile Accidents. The file accidentsFull.csv contains information on 42,183 actual automobile accidents in 2001 in the United
Question:
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, using the Generate Attributes operator, create a new attribute called INJURY that takes the value true if MAX_SEV_IR = 1 or 2, and otherwise false.
a. Using the information in this dataset, if an accident has just been reported and no further information is available, what should the prediction be? (INJURY = true or false?) Why?
b. Select the first 12 records in the dataset, and look only at the response (INJURY) and the two predictors WEATHER_R and TRAF_CON_R. (Hint: After selecting only the relevant attributes, review the summary statistics, and consider transforming any 2-class attributes to Binominal type and any multi-class categorical attributes to Polynominal type. Then, assign special roles to any attributes, as needed. Select the subset of records using the Filter Example Range operator.)
i. Create a pivot table that examines INJURY as a function of the two predictors for these 12 records. Use all three variables in the pivot table as rows/columns.
ii. Compute the exact Bayes conditional probabilities of an injury (INJURY = true) given the six possible combinations of the predictors.
iii. Classify the 12 accidents using these probabilities and a threshold of 0.5.
iv. Compute manually the naive Bayes conditional probability of an injury given WEATHER_R = true and TRAF_CON_R = 1.
v. Run a naive Bayes classifier on the 12 records and 2 predictors using RapidMiner. Check the model output to obtain probabilities and classifications for all 12 records. Compare this with the exact Bayes classification. Are the resulting classifications equivalent? Is the ranking (=ordering) of observations equivalent?
c. Let us now return to the entire dataset. Partition the data into training (60%) and holdout (40%).
i. Assuming that no information or initial reports about the accident itself are available at the time of prediction (only location characteristics, weather conditions, 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 predictors (and INJURY as the class label). Note that all predictors are categorical. Transform the predictors appropriately to Binominal or Polynominal type. Show the confusion matrix.
iii. What is the overall error for the holdout set?
iv. What is the percent improvement relative to the naive rule (using the holdout set)?
v. Examine the conditional probabilities in the pivot tables. Why do we get a probability of zero for P(INJURY = false | SPD_LIM = 5)?
Step by Step Answer:
Machine Learning For Business Analytics
ISBN: 9781119828792
1st Edition
Authors: Galit Shmueli, Peter C. Bruce, Amit V. Deokar, Nitin R. Patel