The create_usrdata function creates various types of test datasets.

create_usrdata(
  test_type,
  scores = NULL,
  labels = NULL,
  tsname = NULL,
  base_x = NULL,
  base_y = NULL,
  text_x = NULL,
  text_y = NULL,
  text_x2 = text_x,
  text_y2 = text_y
)

Arguments

test_type

A single string to specify the type of dataset generated by this function.

"bench"

Create a test dataset for benchmarking

"curve"

Create a test dataset for curve evaluation

scores

A numeric vector to set scores.

labels

A numeric vector to set labels.

tsname

A single string to specify the name of the dataset.

base_x

A numeric vector to set pre-calculated recall values for curve evaluation.

base_y

A numeric vector to set pre-calculated precision values for curve evaluation.

text_x

A single numeric value to set the x position for displaying the test result in a plot

text_y

A single numeric value to set the y position for displaying the test result in a plot

text_x2

A single numeric value to set the x position for displaying the test result (group into categories) in a plot

text_y2

A single numeric value to set the y position for displaying the test result (group into categories) in a plot

Value

A list of R6 test dataset objects.

See also

create_testset for creating a predefined test set. TestDataB for benchmarking test data. TestDataC for curve evaluation test data.

Examples

## Create a test dataset for benchmarking
testset2 <- create_usrdata("bench",
  scores = c(0.1, 0.2), labels = c(1, 0),
  tsname = "m1"
)
testset2
#> $m1
#> 
#>     === Test dataset for prcbench functions ===
#> 
#>     Testset name:     m1 
#>     # of positives:   1 
#>     # of negatives:   1 
#>     Scores:           0.1 (min) 
#>                       0.15 (mean) 
#>                       0.2 (max) 
#>     Labels:           0 (neg), 1 (pos)
#> 
#> 

## Create a test dataset for curve evaluation
testset <- create_usrdata("curve",
  scores = c(0.1, 0.2), labels = c(1, 0),
  base_x = c(0, 1.0), base_y = c(0, 0.5)
)
testset
#> $usr
#> 
#>     === Test dataset for prcbench functions ===
#> 
#>     Testset name:     usr 
#>     # of positives:   1 
#>     # of negatives:   1 
#>     Scores:           0.1 (min) 
#>                       0.15 (mean) 
#>                       0.2 (max) 
#>     Labels:           0 (neg), 1 (pos)
#>     Pre-calculated:   Yes
#>     # of base points: 2 
#>     Text position:    (0.75, 0.25)
#>     Text position2:   (0.75, 0.25)
#> 
#>