lrn = makeLearner("regr.rpart")
fit = train(lrn, bh.task)
pd = generatePartialPredictionData(fit, bh.task, "lstat")
plotPartialPrediction(pd)
lrn = makeLearner("classif.rpart", predict.type = "prob")
fit = train(lrn, iris.task)
pd = generatePartialPredictionData(fit, iris.task, "Petal.Width")
plotPartialPrediction(pd)
Run the code above in your browser using DataLab