Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(tidyverse)
- library(readr)
- library(FNN)
- library(rpart)
- library(C50)
- library(nnet)
- library(FME)
- for (i in 1:length(churn$Churn.)) {
- if(churn$State[i]== "CT" | churn$State[i]== "DE"| churn$State[i]== "FL" | churn$State[i]== "GA" | churn$State[i]== "IN" | churn$State[i]== "ME" | churn$State[i]== "MD" | churn$State[i]== "MA" |churn$State[i]== "MI" |churn$State[i]== "NH" |churn$State[i]== "NJ" | churn$State[i]== "NY" |churn$State[i]== "NC" | churn$State[i]== "OH" |churn$State[i]== "PA" |churn$State[i]== "RI" |churn$State[i]== "SC" | churn$State[i]== "VT" | churn$State[i]== "VA" |churn$State[i]== "DC" | churn$State[i]== "WV" ) {
- churn$state.cat.east[i]<-1
- } else {
- churn$state.cat.east[i]<-0
- }
- }
- for (i in 1:length(churn$Churn.)) {
- if(churn$State[i]== "AL" | churn$State[i]== "AR" | churn$State[i]== "IL" | churn$State[i]== "IA" | churn$State[i]== "KS" | churn$State[i]== "KY" | churn$State[i]== "LA" | churn$State[i]== "MN" | churn$State[i]== "MS" | churn$State[i]== "MO" | churn$State[i]== "NE" | churn$State[i]== "ND" | churn$State[i]== "OK" | churn$State[i]== "SD" | churn$State[i]== "TN" | churn$State[i]== "TX" | churn$State[i]== "WI" ) {
- churn$state.cat.central[i]<-1
- } else {
- churn$state.cat.central[i]<-0
- }
- }
Add Comment
Please, Sign In to add comment