s2net (version 1.0)

simulate_extra: Simulate extrapolated data

Description

Simulated data scenarios described in the paper from Ryan and Culp (2015).

Usage

simulate_extra(n_source = 100, n_target = 100, p = 1000, shift = 10, 
               scenario = "same", response = "linear", sigma2 = 2.5)

Arguments

n_source

Number of source samples (labeled)

n_target

Number of target samples (unlabeled)

p

Number of variables ( p > 10)

shift

The shift applied to the first 10 columns of xU.

scenario

Simulation scenario. One of "same" (same distribution), "lucky" (extrapolation with lucky \(\beta\)), "unlucky" (extrapolation with unlucky \(\beta\))

response

Type of response: "linear" or "logit"

sigma2

The variance of the error term, linear response case.

Value

A list, with

xL

data frame with the labeled (source) data

yL

labels associated with xL

xU

data frame with the unlabeled (target) data

yU

labels associated with xU (for validation/testing)

References

Ryan, K. J., & Culp, M. V. (2015). On semi-supervised linear regression in covariate shift problems. The Journal of Machine Learning Research, 16(1), 3183-3217.

See Also

simulate_groups

Examples

Run this code
# NOT RUN {
set.seed(0)
data = simulate_extra()

train = s2Data(data$xL, data$yL, data$xU)
valid = s2Data(data$xU, data$yU, preprocess = train)

model = s2netR(train, s2Params(0.1))
ypred = predict(model, valid$xL)
plot(ypred, valid$yL)
# }

Run the code above in your browser using DataCamp Workspace