data = DSWE::data1
trainindex = 1:50 #using the first 50 data points to train the model
traindata = data[trainindex,]
xCol = 2 #input variable columns
yCol = 7 #response column
trainX = as.matrix(traindata[,xCol])
trainY = as.numeric(traindata[,yCol])
tempGPObject = tempGP(trainX, trainY)
testdata = DSWE::data1[101:110,] # defining test data
testX = as.matrix(testdata[,xCol, drop = FALSE])
predF = predict(tempGPObject, testX)
Run the code above in your browser using DataLab