I am writing a routine for logistic regression with lasso in matlab
. So the problem is to minimize the negative log-likelihood function with the penalty term
$$\sum \left(\log(1 + e^{X_i' \beta}) - y_i X_i' \beta\right) + \lambda \sum |\beta_i|$$
where $\beta$ is the model parameter, $X_i$ is the $i$th row of matrix $X$, and $y_i$ is the value of observation $i$.
My first question is for a 5-fold cross-validation, which criterion should I use to pick the best value of $\lambda$? Should I use the value of the logit function on the validating data set or mis-classification rate on the validating data?