Prediction of type = “response” is not working
Opened this issue · 0 comments
bappa10085 commented
I was trying to use deepboost for prostate cancer dataset. The dataset can be downloaded from https://www.kaggle.com/multi8ball/prostate-cancer. When I am using predict(fit.dpb, dataTest, type = "response")
, it is returning me NA. Here is the code I am using
prc <- read.csv("Prostate_Cancer.csv",stringsAsFactors = FALSE)
prc <- na.omit(prc[-1]) #removes the first variable(id) from the data set.
normalize <- function(x) {
return ((x - min(x)) / (max(x) - min(x))) }
prc_n <- as.data.frame(lapply(prc[2:9], normalize))
summary(prc_n)
df <- cbind(prc_n,diagnosis_result= prc$diagnosis_result)
head(df,2)
# create a list of 70% of the rows in the original dataset we can use for training
set.seed(123)
training <- sample(nrow(df), 0.7 * nrow(df))
dataTrain <- df[training,]
dataTest <- df[-training,]
#Deepboost
library(deepboost)
deepboost.gridSearch(diagnosis_result~., dataTrain, k = 10, seed = 666, logging_level = 1)
fit.dpb <-deepboost(diagnosis_result ~ .,
dataTrain,
num_iter=50, beta=1, lambda= 1e-04)
predict(fit.dpb, dataTrain, type = "terms")
predict(fit.dpb, dataTest, type = "response")