The data we analyzed was Credit Card Data and the attrition rates of customers.
We had a total of 10,127 observations in this data set.
The data was split into two sections, attrited customers and existing customers. ## Algorithm used
The algorithm that we used to sort and analyze our data was the Random Forest algorithm.
Our model predicted that 448 customers were going to leave, however only 421 actually left.
our model has an accuracy of roughly 94%, with a 6% level of error.
The cost of my program is 448 * 100 = $44,800
We will save 30% of 421 = 126.3, which has a value of 2300x * 117.6 = $290,490
The net of this program is $290,498 - $44,800 = $245,698 from 3034
Per customer is $245,698 / 3034 = $80.98 per customer
rf$importance %>%
data.frame() %>%
rownames_to_column(var = "Feature") %>%
ggplot(aes(x = fct_reorder(Feature, MeanDecreaseAccuracy), y = MeanDecreaseAccuracy)) +
geom_pointrange(aes(ymin=0, ymax = MeanDecreaseAccuracy), color = "cadetblue", size = .3) +
theme_minimal() +
coord_flip() +
labs(x = "", title = "Variable Importance using MeanDecreasingAccuracy")
val$predicted_Attrition_FLag <- predict(rf , val)
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.