Skip to contents

aurroc is the Mann-Whitney AUC P(S+ > S-) + P(tie)/2; glmpoi the Poisson GLM by IRLS (as stats::glm(family = poisson)); kmeans2 Lloyd k-means (KmeansLloyd) from n_init Philox-drawn starts keeping the least within-cluster SSE (0-based labels); rdgr ridge regression (Xc'Xc + alpha I)^-1 Xc'yc with an unpenalised intercept.

Usage

aurroc(y_true, score)

glmpoi(X, y, add_intercept = TRUE, tol = 1e-12, maxit = 100)

kmeans2(X, n_clusters = 3, n_init = 10, random_state = 42)

rdgr(X, y, alpha = 1, fit_intercept = TRUE)

Arguments

y_true

Binary labels (1 positive).

score

Scores.

X

Regressors (or data matrix for kmeans2).

y

Response.

add_intercept, fit_intercept

Include an intercept.

tol

Relative deviance tolerance.

maxit

Maximum IRLS iterations.

n_clusters

Number of clusters.

n_init

Number of random starts.

random_state

Philox seed.

alpha

Ridge penalty.

Value

Lists with the components of the Python arm's payload.

References

Hanley, J. A. and McNeil, B. J. (1982). The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology 143, 29-36. McCullagh, P. and Nelder, J. A. (1989). Generalized Linear Models, 2nd ed. Chapman and Hall. Lloyd, S. P. (1982). Least squares quantization in PCM. IEEE Transactions on Information Theory 28, 129-137. Hoerl, A. E. and Kennard, R. W. (1970). Ridge regression. Technometrics 12, 55-67.

Examples

aurroc(c(0, 0, 1, 1, 0, 1), c(0.1, 0.4, 0.35, 0.8, 0.4, 0.9))$value
#> [1] 0.7777778
rdgr(matrix(1:4), c(1, 2.1, 2.9, 4.2))$coef
#> [1] 0.8666667