Guest User

Untitled

a guest
Jan 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. library(caTools)
  2.  
  3. thedata2 <- read.csv("c:UsersPublicDesktopcreditcard.csv", TRUE, ",")
  4.  
  5. set.seed(2)
  6. split <- sample.split(thedata2, SplitRatio=0.7)
  7.  
  8. train <- subset(thedata2, split=TRUE)
  9. Actual <- subset(thedata2, split=FALSE)
  10.  
  11. #Create the model
  12. Model <- lm(Class ~.,data=train)
  13. #Prediction
  14. Prediction <- predict(Model, Actual)
  15.  
  16. #Comparing predicted vs actual model
  17. plot(Actual$Class,type = "l",lty= 1.8,col = "red")
  18. lines(Prediction, type = "l", col = "blue")
  19. plot(Prediction,type = "l",lty= 1.8,col = "blue")
Add Comment
Please, Sign In to add comment