Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(caTools)
- thedata2 <- read.csv("c:UsersPublicDesktopcreditcard.csv", TRUE, ",")
- set.seed(2)
- split <- sample.split(thedata2, SplitRatio=0.7)
- train <- subset(thedata2, split=TRUE)
- Actual <- subset(thedata2, split=FALSE)
- #Create the model
- Model <- lm(Class ~.,data=train)
- #Prediction
- Prediction <- predict(Model, Actual)
- #Comparing predicted vs actual model
- plot(Actual$Class,type = "l",lty= 1.8,col = "red")
- lines(Prediction, type = "l", col = "blue")
- plot(Prediction,type = "l",lty= 1.8,col = "blue")
Add Comment
Please, Sign In to add comment