The letter A is the best (highest) credit rating because it has the lowest default rate (0.059) and the default rate increases as the credit rating for each subsequent letter grade.
Modeling
Logistic Regression
Run a logistic regression on loanTrain data and store the result in glmBase.
A mean close to zero and a small median are a good early sign. However, the min of -0.997 indicates that the model failed to predict a bad loan by assigning a 0.003236 probability to a default (0.003 = 1 - 0.997). The max of 0.466 was also not so good.
Decision Tree
To make the dataset balanced, we trick R by giving it a balanced dataset where 1/3 of the cases are default and 2/3 are are not default.
I based my cutoff on the fact that 0.1121 of test cases are bad loans. Specifically, I sorted the predictionsBase vector in non-decreasing order (using sort() function with decreasing = TRUE), and then I set the value of cutoff equal to value of the element number as.integer(0.1121 * length(sortedPredictionBase)) of the sorted list.