hit.curve {EPX} | R Documentation |
Plot hit curve
Description
Plots the hit curve corresponding to phat
and y
.
Usage
hit.curve(y, phat, max.cutoff = min(100, length(y)), plot.hc = T, ...)
Arguments
y |
True binary response vector where 1 denotes the relevant rare class. |
phat |
Vector of estimated probabilities of relevance. |
max.cutoff |
Maximum number of observations selected, equivalently the
maximum shortlist cutoff; default is |
plot.hc |
Whether to return a plot of the hit curve; default is
|
... |
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 plot.epx for plotting the hit curve for an "epx
"
object.
Value
Plot of the hit curve (if plot.hc = TRUE
) and a list with the
following vectors:
select |
Number of observations in each tied |
p |
Unique |
nhits |
Number of hits (truly relevant observations) in each tied
|
nhitlast |
Number of hits after |
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))
## Plot hit curve for cross-validated predicted probabilities of relevence
set.seed(761)
model.cv <- cv.epx(model)
preds.cv <- model.cv[-nrow(model.cv), ncol(model.cv)]
cv.hc <- hit.curve(phat = as.numeric(preds.cv), y = model$Y)