What leads to discontinuities in the deviance plot from plot.cv.glmnet? I'm running L1-penalized logistic regression with cv.glmnet.
When plotting the mean binomial deviance against a range of Log(λ) using plot.cv.glmnet(), the plot displays two discontinuities. 

This is also present when plotting the deviance standard deviation (cv$cvsd). 

However, the deviance ratio (cv$glmnet.fit$dev.ratio) does not display these discontinuities.

Has anyone else seen this behavior and do you know what is the likely cause? Thank you!
 A: For the first plot, you do not have a lot of data points, so sometimes you some chinks because cv.glm do a 10 fold cross-validation, and the test fold will be small, giving you some instability, for example, using a dataset from uci, I sample from the full data, 200, 500 or 2000 datapoints, fit a cv.glmnet and plot like you did:
data = read.csv("http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data",header=FALSE,na.string="?")

colnames(data) = c ("age", "workclass", "fnlwgt", "education", "educationnum", 
              "maritalstatus", "occupation", "relationship", "race", "sex", 
              "capitalgain", "capitalloss", "hoursperweek", "nativecountry",
              "incomelevel")

data = data[complete.cases(data),]

plotfit = function(dat,title){
dat$incomelevel = as.numeric(dat$incomelevel)-1
y = cv.glmnet(x=model.matrix(incomelevel~0+.,data=dat),y=dat$incomelevel)
plot(y,main=title)
}

par(mfrow=c(3,3))
for(N in c(200,500,2000)){
  for(rep in 1:3){
    plotfit(data[sample(nrow(data),N),],paste("N=",N,rep))
}
}


You can see when n is 200 the intervals are larger and you have a weird shape. It gets stable once you reach a larger number.
For the second plot, it's a scale issue. You have the standard deviation of the MSE across CVs, so a larger mse mean will give larger sd (scale wise).
Third plot, when you go into cv$glmnet.fit$dev.ratio, this is the final glmnet fit, after getting the optimal parameter from the CV. Here you fit all your data using the different lambdas defined. Hence you don't see so much of a kink anymore
