Random forest in shiny

...i am trying to implement random forest method in shiny , i was trying to print confusion matrix below code but didn't work . how can i solve the error .

rftrain <-reactive({ 
        randomForest(ID~., data = train_data())
    })
    rfconf<-reactive({
     predict(rftrain, test_data(), test_data$ID)
    
    })
    output$rft<-renderText({
        confusionMatrix(rfconf,rftrain)
    })
output$dtlevel<-renderText({
    rfconf()
})

its hard to identify errors without your data (see reprex), or your entire code ( see reprex again).
but there is an obvious syntax error

output$rft<-renderText({ confusionMatrix(rfconf(),rftrain()) })

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.