library(ggplot)
library(ggplot2)
library(GGally)
library(Matrix)
library(foreach)
library(glmnet)
##Plot the datsetggpairs(iris, colour='Species', alpha=0.4)
## 70% of the sample sizesmp_size <- floor(0.70 * nrow(iris))
## set the seed to make your partition reproductibleset.seed(123)
train_ind <- sample(seq_len(nrow(iris)), size = smp_size)
train <- iris[train_ind, ]
test <- iris[-train_ind, ]
#prepare feature and output matrices for training settrain_features<-train[,c("Sepal.Length","Sepal.Width","Petal.Length","Petal.Width")]
train_output<-as.numeric(train[,c("Species")])
#prepare feature and output matrices for test settest_features<-test[,c("Sepal.Length","Sepal.Width","Petal.Length","Petal.Width")]
test_output<-as.numeric(test[,c("Species")])
#fit OLS Linear Model lm_model=lm(train_output~.,data=train_features)#get model outputs summary(lm_model)
#plot model charactersitics layout(matrix(1:4,2,2))
plot(model)