Search code examples
rmachine-learningsvmlibsvmrisk-analysis

credit score from SVM probabilities in R


I am trying to calculate credit scores for the germancredit dataframe in R. I used linear SVM classifier to predict 0 and 1 (i.e. 0 = good, 1 = bad).

I managed to produce probabilities from SVM classifier using the following code.

final_pred = predict(classifier, newdata = data_treated[1:npredictors], decision.values = TRUE, probability = TRUE)

probs = attr(final_pred,"probabilities")

I want to know how to read these probabilities output. The sample output is here. Does the following output mean that, if the prediction is 1 (Default) in fifth row, then probability is 0.53601166.

              0          1 Prediction
1    0.90312125 0.09687875 0
2    0.57899408 0.42100592 0
3    0.93079172 0.06920828 0
4    0.76600082 0.23399918 0
5    0.46398834 0.53601166 1

Can I then use the above respective probabilities to develop credit scorecard like we usually do with logistic regression model


Solution

  • You get a probability for outcome 0 or 1. The first two columns for each row sum to one and give you the overall probability. Your interpretation seems correct to me, i.e. with a probability of 0.53 it is more likely that a default will happen, than the probability of no default happening with p = 0.46.

    Yes, you could use that model for developing a credit scorecard. Please mind, that you don't necessarily need to use 0.5 as your cutoff value for deciding if company or person X is going to default.