Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.

How to change measure and resampling and maximize kappa value? #6

@GegznaV

Description

@GegznaV

In a HyperControl object, is there a way to change either measure or resampling (or both) and leave other settings at their defaults?

This code results in error:

makeHyperControl(resampling = cv3,  measures   = kappa)
## Error in makeHyperControl(resampling = cv3, measures = kappa) : 
## Assertion on 'mlr.control' failed: Must have class 'TuneControl', but has class 'NULL'.

And manual modification of fields result in unexpected outcome:

set.seed(1)
# Create the object:
h_ctrl <- generateHyperControl(task = sonar.task, learner = "classif.ranger")
# Manually modify the fields:
h_ctrl <- makeHyperControl(h_ctrl$mlr.control,
                           resampling = cv3, 
                           measures   = kappa,
                           par.config = h_ctrl$par.config)
# Tune
h_params <- hyperopt(sonar.task,
                     learner = "classif.ranger",
                     hyper.control = h_ctrl,
                     show.info = FALSE)

h_params
## Op. pars: mtry=1; min.node.size=2
## kappa.test.mean=-0.64

It seems that it was searched for the minimum kappa value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions