Learn R Programming

glmtrans (version 2.1.0)

plot.glmtrans: Visualize the losses of different sources and the threshold to determine transferability.

Description

Plot the losses of different sources and the threshold to determine transferability for object with class "glmtrans" or "glmtrans_source_detection".

Usage

# S3 method for glmtrans
plot(x, ...)

Value

a "ggplot" visualization with the transferable threshold and losses of different sources.

Arguments

x

an object from class "glmtrans" or "glmtrans_source_detection", which are the output of functions glmtrans and source_detection, respectively.

...

additional arguments that can be passed to ggplot function.

References

Tian, Y., & Feng, Y. (2023). Transfer learning under high-dimensional generalized linear models. Journal of the American Statistical Association, 118(544), 2684-2697.

See Also

glmtrans, source_detection, ggplot.

Examples

Run this code
set.seed(1, kind = "L'Ecuyer-CMRG")

D.training <- models("gaussian", K = 2, p = 500, Ka = 1)

# plot for class "glmtrans"
fit.gaussian <- glmtrans(D.training$target, D.training$source)
plot(fit.gaussian)

# \donttest{
# plot for class "glmtrans_source_detection"
detection.gaussian <- source_detection(D.training$target, D.training$source)
plot(detection.gaussian)
# }

Run the code above in your browser using DataLab