L2CVSearch
This is a function for performing cross validation for optimizing the L2 regularization parameter. It uses a basic hill climbing algorithm to search a range of parameters. It returns: cv_likelihoods, a matrix of the cross validated log likelihoods for each fold; L2_reg_params, the log L2 parameters tested and mean_cvpl, the mean log likelihood for each L2 parameter tested.
Parameters:
x_train- training set matrix. Expected numpy array.ytime_train- time of death or censoring for each patientystatus_train- censoring of each patientmodel_params = {}- model parameters, seetrainCoxMlpsearch_params = {}- model search/training parameters, seetrainCoxMlpcv_params- cross validation parameters, see below.verbose=True- print more stuff.
cv_params is a dictionary of parameters for cross validation. It has the following parameters:
cv_seed- Random seed for splitting validation folds. Default is 1.n_folds- Number of folds to cross-validate. Default is 10.cv_metric- Performance metric for evaluating cross-validation performance. loglikelihood or cindex. Default is loglikelihood.search_iters- Number of iterations in hill climbing. Default is 3.L2_range- Range to search for L2 parameter. Default [-5,-1].