cvParetoElnet | R Documentation |
Cross-validation procedure to choose alpha and lambda values for regularized tradeoff curve algorithm
cvParetoElnet(
data,
prop,
sr,
k = 5,
rep = 1,
Spac = 21,
alpha.grid = 0,
lambda.grid = 0
)
data |
Calibration data: a dataframe with first p columns as standardized predictor scores, the (p+1)th column as standardized job performance ratings, and the (p+2)th column (rightmost column) as a race dummy; all data should be numeric |
prop |
Proportion of minority applicants in total applicant pool (#minority applicants/#total applicants) |
sr |
Selection ratio |
k |
Number of folds, default is 5 |
rep |
Number of repeats if doing repeated k-fold CV |
Spac |
Number of Pareto-optimal solutions, default is 21 |
alpha.grid |
Vector of alpha values to try |
lambda.grid |
Vector of lambda values to try |
A list containing the following:
Predictor weights obtained based on best alpha and lambda values
Best alpha parameter value
Best lambda parameter value
# Calibration data
# (1) Calibration data
# Format: Predictor_1, ..., Predictor_n, Job Performance Validity, Race dummy variable
# (e.g., 0-minority; 1-majority)
# All data should be numeric
# sample_data
# (3) Alpha values to try
alpha.grid <- seq(0, 1, length = 2)
# (4) Lambda values to try
lambda.grid <- 10^seq(1, -2, length = 4)
# (5) Proportion of minority applicants (prop) = (# of minority applicants)/(total # of applicants)
prop <- 1/4
# (6) Selection ratio (sr) = (# of selected applicants)/(total # of applicants)
sr <- 0.10
# (7) Spac = number of Pareto points
Spac <- 21
# Fit Regularized Pareto-optimal model with parameter selection via cross-validation
## May take a while
out <- cvParetoElnet(data = sample_data, prop = prop, sr = sr, Spac = Spac,
k = 5, rep = 1,
lambda.grid = lambda.grid, alpha.grid = alpha.grid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.