Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Set seed for reproducibility
- set.seed(42)
- # Randomly sample 70% of data indices for training set
- train_indices <- sample(1:nrow(credit), nrow(credit)*0.7)
- # Create training and testing datasets
- train_data <- credit[train_indices, ]
- test_data <- credit[-train_indices, ]
- # Build logistic regression model
- model2 <- glm(upgraded ~ purchases + extraCards, family = binomial, data = credit)
- # Output of logistic regression model
- summary(model2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement