Random Forest
Random Forest
treating those who have taxable_income <= 30000 as "Risky" and others are
"Good"
model<-
randomForest(Fraud_check_$Taxable.Income~.,data=Fraud_check_,ntree=600
)
# View the forest results.
print(model)
Risk = ifelse(Fraud_check_$Taxable.Income<= 30000, "Risky", "Good")
Fraud= data.frame(Fraud_check_,Risk)
Fraud1 = Fraud[,c(1:6)]
str(Fraud)#Imoporantce of the variable - Lower Gini
table(FC$Risk)
Call:
randomForest(formula = Fraud_check_$Taxable.Income ~ ., data =
Fraud_check_, ntree = 600)
Type of random forest: regression
Number of trees: 600
No. of variables tried at each split: 1
Good Risky
476 124