title: how to get probabilities between 0 and 1 using glmnet logistic regression
body: <h3>consider the following example</h3>
  
  <pre><code>rm(list = ls(all=T))
  library(ISLR)
  library(glmnet)
  
  Hitters=na.omit(Hitters)
  
  # Binary proble - Logistic regression
  Hitters$Salary &lt;- ifelse(Hitters$Salary &gt; 1000, 1, 0)
  Hitters$Salary &lt;- as.factor(Hitters$Salary)
  
  # the class is unbalanced
  # &gt; table(Hitters$Salary)
  # 0   1 
  # 233  30 
  
  # cls &lt;- sapply(Hitters, class)
  # for(j in names(cls[cls == 'integer'])) Hitters[,j] &lt;- as.double(Hitters[,j])
  
  x = model.matrix(~ . -1, Hitters[,names(Hitters)[!names(Hitters) %in% c('Salary')]] )
  
  inx_train &lt;- 1:200
  inx_test &lt;- 201:dim(Hitters)[1]
  
  x_train &lt;- x[inx_train, ]
  x_test &lt;- x[inx_test, ]
  y_train &lt;- Hitters[inx_train, c('Salary')]
  y_test &lt;- Hitters[inx_test, 'Salary']
  
  fit = cv.glmnet(x=x_train, y=y_train, alpha=1, type.measure='auc', family = "binomial")
  plot(fit)
  
  pred = predict(fit, s='lambda.min', newx=x_test)
  
  quantile(pred)
  # 0%       25%       50%       75%      100% 
  # -5.200853 -3.704760 -2.883836 -1.937052  1.386215 
  </code></pre>
  
  <p><strong>Given the above probabilities, which function or parameter in predict should I use/modify to transform them between 0 and 1?</strong></p>