Error : Unused Arguments

I am trying to use the "mlr" library in R and the "c50" algorithm on the iris dataset (using the F1 score as the metric) :

library(mlr)
library(C50)
data(iris)

zooTask <- makeClassifTask(data = iris, target = "Species")
forest <- makeLearner("classif.C50")

forestParamSpace <- makeParamSet(
makeIntegerParam("minCases", lower = 1, upper = 100))


randSearch <- makeTuneControlRandom(maxit = 100)


cvForTuning <- makeResampleDesc("CV", iters = 5,  measures = f1)


tunedForestPars <- tuneParams(forest, task = zooTask,
resampling = cvForTuning,
par.set = forestParamSpace,
control = randSearch)



tunedForestPars

But this results in the following error:

Error in makeResampleDescCV(iters = 5, measures = list(id = "f1", minimize = FALSE, :
unused argument (measures = list("f1", FALSE, c("classif", "req.pred", "req.truth"), function (task, model, pred, feats, extra.args)
{
measureF1(pred$data$truth, pred$data$response, pred$task.desc$positive)
}, list(), 1, 0, "F1 measure", "Defined as: 2 * tp/ (sum(truth == positive) + sum(response == positive))", list("test.mean", "Test mean", function (task, perf.test, perf.train, measure, group, pred)
mean(perf.test), "req.test")))

Can someone please show me how to fix this?

Thanks

are you not using a measures param in the wrong place ?
I believe it fit in tuneParams rather than makeresampledesc.
Also to know what measures can be used in classification , with a multi class setup use

listMeasures(obj = "classif", properties = "classif.multi")

f1 is not one of those option...

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.