View source: R/tool_interface.R
create_usrtool | R Documentation |
The create_toolset
function takes names of predefined tools and
generates a list of wrapper functions for Precision-Recall curve
calculations.
create_usrtool(
tool_name,
func,
calc_auc = TRUE,
store_res = TRUE,
x = NA,
y = NA
)
tool_name |
A single string to specify the name of a user-defined tool. |
func |
A function to calculate a Precision-Recall curve and the AUC. It
should take an element of the test dataset generated by
|
calc_auc |
A Boolean value to specify whether the AUC score should be calculated. |
store_res |
A Boolean value to specify whether the calculated curve is retrieved and stored. |
x |
Set pre-calculated recall values. |
y |
Set pre-calculated precision values. |
A list of R6
tool objects.
create_toolset
to create a predefined tool set.
create_testset
for testset
.
create_example_func
to create an example function.
## Create a new tool interface called "xyz"
efunc <- create_example_func()
toolset1 <- create_usrtool("xyz", efunc)
toolset1
## Example function with a correct argument
testset <- create_usrdata("bench", scores = c(0.1, 0.2), labels = c(1, 0))
retf <- efunc(testset[[1]])
retf
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.