Load the R package

library(stratifiedSSL)

Load the simulated data

# Parameters used for generating the simulated data
n_lab <- 400
n_unlab <- 20000
p <- 10
rho <- 0.4
num_strata <- 2

# Load the simulated data.
data(simulation_data)
# Format the data.
X_labeled <- simulation_data$covariates_lab
X_unlabeled <- simulation_data$covariates_unlab
S_unlabeled <- simulation_data$S_unlab
S_labeled <- simulation_data$S_lab
y <- simulation_data$Y_lab
samp_prob <- simulation_data$samp_prob

# Additional parameters
basis_type <- 'NS_basis'
reps <- 2
num_perts <- 2
num_knots <- 3
basis_type <- 'NS_basis'
my_threshold <- 0.5
num_folds <- 3

Run the full analysis

stratifiedSSL_results <- RunStratifiedSSL(X_labeled, X_unlabeled, S_labeled, 
                                          S_unlabeled, y, samp_prob, n_lab,
                                          num_knots, basis_type, num_folds, 
                                          my_threshold, reps, num_perts)