plot.epx {EPX}R Documentation

Plot hit curve for an "epx" object

Description

Plots the hit curve for the fitted values of an "epx" object.

Usage

## S3 method for class 'epx'
plot(x, max.cutoff = min(100, length(x$Y)), plot.hc = TRUE, ...)

Arguments

x

Object of class "epx".

max.cutoff

Maximum number of observations selected, equivalently the maximum shortlist cutoff; default is min(100, length(x$Y)).

plot.hc

Whether to make a plot of the hit curve; default is TRUE.

...

Further arguments passed to or from other methods.

Details

Order the cases by decreasing phat (predicted probabilities of relevance) values, and plot the expected number and actual number of hits as cases are selected. Cases with tied phat values are grouped together. See hit.curve in order to plot a hit curve in general.

Value

Plot of the hit curve (if plot.hc = TRUE) and a list with the following vectors:

select

Number of observations in each tied phat group; select[1], select[2], ... are the numbers of observations with the largest predicted probability of relevance (max(phat)), the second largest value in phat, etc.

p

Unique phat values; p[1], p[2], ... are the largest value in phat, the second largest value in phat, etc.

nhits

Number of hits (truly relevant observations) in each tied phat group.

nhitlast

Number of hits after max.cutoff observations selected.

Examples

# Example with data(harvest)

## Phalanx-formation using a base classifier with 50 trees (default = 500)

set.seed(761)
model <- epx(x = harvest[, -4], y = harvest[, 4],
             classifier.args = list(ntree = 50))

## Hit curve for model with default settings
model.hc <- plot(model)

## In the top 100 ranked observations selected, the number that are truly
## relevant is
model.hc$nhitlast

## Hit curve with max.cutoff at 150 (Note: Commented off for time.)
model.hc.150 <- plot(model, max.cutoff = 150)
model.hc.150$nhitlast  # Number of hits in top 150 ranked observations.


[Package EPX version 1.0.4 Index]