-## Inspiration Improving Customer Experience through Data
What it does
Uses Factors from Customer Rep Given Survey to Predict Rate Plan, Features, Accessories and Devices for Customers
How I built it
R,RShiny, RStudio Cloud
Challenges I ran into
Discovering Significant Predictors of Customer Choices and Market Research
Accomplishments that I'm proud of
Made Successful Prediction Program
What I learned
Linear Regression Models, Additional Statistics Exposure
What's next for Telly: Telling Customer's Story through Data
Train with Larger Data Set, CSV Aggregation for Individual Customer Data Pools
Code Below
install.packages("readr") library(readr) install.packages("caret") library(caret)
myData <- read.csv(file.choose())
attach(myData) summary(myData)
plot <- ggplot(data=myData, aes(x=Age, y=Credit.Score., col=Current.Plan)) plot <- plot + geom_point(aes(size = 5)) plot <- plot + xlab("Age") + ylab("Credit Score") + scale_color_discrete(name = "Rate Plan") plot
myData$Current.Plan <- factor(myData$Current.Plan)
contrasts(myData$Current.Plan)
inTrain <- createDataPartition(y = myData$Current.Plan, p = .65, list = FALSE) training <- myData[inTrain,] testing <- myData[-inTrain,]
dim(testing)
myData.fit = glm(Current.Plan ~ Age + Credit.Score., data=training, family=binomial)
summary(myData.fit)
myData.prob = predict(myData.fit, testing, type="response") myData.pred = rep("Post-Pay, TM1", dim(training)[1]) myData.pred[myData.prob > .5] = "Pre-Pay" table(myData.pred, training$Current.Plan)
mean(myData.pred == training$Current.Plan)
mean(myData.pred == training$Current.Plan)
1 - mean(myData.pred == training$Current.Plan)
predict(myData.fit, newdata=data.frame(Age=c(26, 31), Credit.Score.=c("Good", "Fair")), type="response") summary(myData.fit)
myData.prob = predict(myData.fit, testing, type="response") myData.pred = rep("Post-Pay, TM1", dim(training)[1]) cats.pred[cats.prob > .5] = "Pre-Pay" table(myData.pred, training$Current.Plan)
mean(myData.pred == training$Current.Plan)
predict(myData.fit, newdata=data.frame(Bwt=c(26, 31)), type="response")
Built With
- azure
- google-spreadsheets
- r
- rstudio
- shiny
Log in or sign up for Devpost to join the conversation.