`#Evaluate the model using Test Data model3 <- model %>% evaluate(testing,testlabels)
#Prediction and Confusion Matrix - test data prob <- model %>%
predict_proba(testing) pred <- model %>% predict_classes(testing)
table3 <- table(Predicted=pred,
Actual=testtarget)`{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE)#Checking
the structure of Data str(train) newtrain <- as.matrix(train)
dimnames(newtrain) <- NULL
str(test) newtest <- as.matrix(test) dimnames(newtest) <- NULL
str(valid) newvalid <- as.matrix(valid) dimnames(newvalid) <- NULL`{r pressure, echo=FALSE} plot(pressure)#Checking the structure of Data traindata <- cbind(statement.svd[1:10269,-1],train) traindata[1,334] str(traindata) newtrain <- as.matrix(traindata) dimnames(newtrain) <- NULL
testdata <- cbind(statement.svd[10270:11552,-1],test) str(testdata) newtest <- as.matrix(testdata) dimnames(newtest) <- NULL````
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
`#Checking the structure of Data str(train) newtrain <- as.matrix(train[,-32]) #Without Search = 32th Column dimnames(newtrain) <- NULL``{r cars} summary(cars) ```
You can also embed plots, for example:
`#Checking the structure of Data str(train) newtrain <- as.matrix(train) dimnames(newtrain) <- NULL
str(test) newtest <- as.matrix(test) dimnames(newtest) <- NULL
str(valid) newvalid <- as.matrix(valid) dimnames(newvalid) <-
NULL`{r pressure, echo=FALSE} plot(pressure)#Checking the
structure of Data traindata <- cbind(statement.svd[1:10269,-1],train)
traindata[1,334] str(traindata) newtrain <- as.matrix(traindata)
dimnames(newtrain) <- NULL
testdata <- cbind(statement.svd[10270:11552,-1],test) str(testdata) newtest <- as.matrix(testdata) dimnames(newtest) <- NULL``
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.