Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

May I know how to visualize the tree model generated in mlr classif.rpart or is it possible to print the tree rules

$
0
0

@apremgeorge wrote:

makeatree <- makeLearner("classif.rpart", predict.type = "response")
set_cv <- makeResampleDesc("CV",iters = 3L)

gs <- makeParamSet(makeIntegerParam("minsplit",lower = 10, upper = 50),makeIntegerParam("minbucket", lower = 5, upper = 50),makeNumericParam("cp", lower = 0.001, upper = 0.2))

gscontrol <- makeTuneControlGrid()

stune <- tuneParams(learner = makeatree, resampling = set_cv, task = trainTask, par.set = gs, control = gscontrol, measures = acc)

t.tree <- setHyperPars(makeatree, par.vals = stune$x)

t.rpart <- train(t.tree, trainTask)

tpmodel <- predict(t.rpart, testTask)

here Visualizing the tree model in rpart.plot() will not work as this is not rpart object, Thanks in advance, Any help is much appreciated, Thanks in Advance

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles