0

I have been attempting to follow this tutorial:

http://edureka.co/blog/data-science-projects

I have reached the following line, but it fails with an error:

confusionMatrix (TrainSet$incomelevel, predict (boostFit, TrainSet))

Error in predict(boostFit, TrainSet) : object 'boostFit' not found

What is the package that should be used in order to use the function "boost Fit"??

I thought I had created it with a previous line in the code:

boostFit = train(incomelevel ~ age + workclass + education + educationnum +
                 maritalstatus + occupation + relationship + race + capitalgain +
                 capitalloss + hoursperweek + nativecountry,
                 trControl = trCtrl, method = "gbm", data = TrainSet,
                 verbose = FALSE)

Does this mean I need to install a package for function boostFit, and if yes then what is the package name??

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. Right now you aren't using `boostFit` as a function, it's just a variable name. Did you create a variable with that name? If not, why is that included in the `predict()`? – MrFlick Jul 09 '20 at 17:52
  • I found this code on this site------------- https://www.edureka.co/blog/data-science-projects/ ----------- I don't know whats wrong with this code, but it's showing this error. It'd be very helpful if anyone could find the solution to this. – Fatty Acids Jul 10 '20 at 12:12
  • and yes, th3e variable with that name was created----- boostFit = train (incomelevel ~ age + workclass + education + educationnum + maritalstatus + occupation + relationship + race + capitalgain + capitalloss + hoursperweek + nativecountry, trControl = trCtrl, method = "gbm", data = TrainSet, verbose = FALSE) – Fatty Acids Jul 10 '20 at 12:17

1 Answers1

0

I had the same issue but once I loaded the CARET package it worked well.