Implement Decision Tree in R.
Create this dataset (Copy this below piece of code and paste it in your R)
----------------------------------------------------------------------------
data <- [login to view URL](
InsuranceID = c(1,2,3,4,5,6,7,8,9,10),
Vehicle_Damage = c(TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE),
Self_Injury = c(TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE),
Claimer_Frequency = factor(c("active", "very active", "very active", "inactive", "very inactive"
, "inactive", "very inactive", "active", "active", "very active"),
levels=c("very inactive", "inactive", "active", "very active"),
ordered=TRUE),
Fraud = c(FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE))
----------------------------------------------------------------------------------------
This data set is used by an Insurance Company to check whether the Claim is fraud or not.
Insurance ID: The Claim ID.
Vehicle Damage: Is the vehicle damage or not?
Self-Injury: Is the person injured or not?
Claimer Frequency: Frequency of the person claiming the Insurance.
Fraud: If this is fraud or not?
Q1. Implement Decision Trees (Hint: use Rpart)
Q2. Find whether the fraud is done or not for Insurance ID 2 and 7?
Q3. Show the Decision Trees by using visualization.