R6 class of test dataset for Precision-Recall curve evaluation.

Format

An R6 class object.

Details

TestDataC is a class that contains scores and label for performance evaluation tools. It provides necessary methods for curve evaluation.

See also

create_testset for creating a list of test datasets. It is derived from TestDataB.

Super class

prcbench::TestDataB -> TestDataC

Methods

Inherited methods


Method set_basepoints_x()

Set pre-calculated recall values for curve evaluation.

Usage

TestDataC$set_basepoints_x(x)

Arguments

x

A recall value.


Method set_basepoints_y()

Set pre-calculated precision values for curve evaluation.

Usage

TestDataC$set_basepoints_y(y)

Arguments

y

A precision value.


Method get_basepoints_x()

Get pre-calculated recall values for curve evaluation.

Usage

TestDataC$get_basepoints_x()


Method get_basepoints_y()

Get pre-calculated precision values for curve evaluation.

Usage

TestDataC$get_basepoints_y()


Method set_textpos_x()

Set the position x for displaying the test result in a plot.

Usage

TestDataC$set_textpos_x(x)

Arguments

x

Position x of the test result.


Method set_textpos_y()

Set the y position for displaying the test result in a plot.

Usage

TestDataC$set_textpos_y(y)

Arguments

y

Position y of the test result.


Method set_textpos_x2()

Set the x position for displaying the test result in a plot.

Usage

TestDataC$set_textpos_x2(x)

Arguments

x

Position x of the test result.


Method set_textpos_y2()

Set the y position for displaying the test result in a plot.

Usage

TestDataC$set_textpos_y2(y)

Arguments

y

Position y of the test result.


Method get_textpos_x()

Get the position x for displaying the test result in a plot.

Usage

TestDataC$get_textpos_x()


Method get_textpos_y()

Get the position y for displaying the test result in a plot.

Usage

TestDataC$get_textpos_y()


Method get_textpos_x2()

Get the x position for displaying the test result in a plot.

Usage

TestDataC$get_textpos_x2()


Method get_textpos_y2()

Get the y position for displaying the test result in a plot.

Usage

TestDataC$get_textpos_y2()


Method clone()

The objects of this class are cloneable with this method.

Usage

TestDataC$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

## Initialize with scores, labels, and a dataset name
testset <- TestDataC$new(c(0.1, 0.2), c(1, 0), "c4")
testset
#> 
#>     === Test dataset for prcbench functions ===
#> 
#>     Testset name:     c4 
#>     # 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: 1 
#>     Text position:    (0.75, 0.25)
#>     Text position2:   (0.75, 0.25)
#> 

## Set base points
testset$set_basepoints_x(c(0.13, 0.2))
testset$set_basepoints_y(c(0.5, 0.6))
testset
#> 
#>     === Test dataset for prcbench functions ===
#> 
#>     Testset name:     c4 
#>     # 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)
#>