这是我在R studio中的代码:
# First install devtools
install.packages("devtools")
# Load devtools
library(devtools)
# install RBM
install_github("TimoMatzen/RBM")
force = TRUE
# load RBM
library(RBM)
Wednesdaydataset <- read.csv('C:\\Users\\FSKKP\\Desktop\\R iqa\\data set-20181220T065754Z-001\\data set\\Wednesday-workingHours.pcap_ISCX.csv')
# Load the Wednesdaydataset data
data(Wednesdaydataset)
set.seed(1234)
ind<-sample(2,nrow(Wednesdaydataset),replace = TRUE,prob=c(0.7,0.30))
train.data<-mat [ind==1,]
test.data<-mat [ind==2,]
ind<-sample(2,nrow(train.data),replace = TRUE,prob=c(0.6,0))
train2.data<-mat [ind==1,]
view(train2.data)
ind<-sample(2,nrow(test.data),replace = TRUE,prob=c(0.6,0))
test2.data<-mat [ind==1,]
view(test2.data)
# First get the train data from train.data
train <- Wednesdaydataset$Label
# Then fit the model
modelRBM <-RBM(x = train, n.iter = 1000, n.hidden = 100, size.minibatch = 10)
# Get the test data from MNIST
test <- Wednesdaydataset$Label
# First get the train labels of MNIST
train2.data <- train2.data$Label
# This time we add the labels as the y argument
modelClassRBM <- RBM(x = train, y = train2.data, n.iter = 1000, n.hidden = 100, size.minibatch = 10)
# First get the test labels of MNIST
test2.data <- test2.data$Label
# Give our ClassRBM model as input
PredictRBM(test = test, labels = test2.data, model = modelClassRBM)
以下是我的输出错误: enter image description here
我应该怎么做才能更正我在R studio中的编码?我的预期输出应该像这样,并具有数据集的准确性: