how to do stacking for credit risk in matlab?using Neural network and KNN base learner

1 view (last 30 days)
Hi all I conducting research for credit risk predication and I want to combine both Neural network and knn for better accuracy predication using Stacking approach where the stacked model learner is Decision tree, so I would like to know how to do in matlab?
for instance: I have 19 inputs (Features) with one output the credit risk predication in (0/1)
I used neural network to give me the predication with accuracy 86% with KNN gives me accuracy of 88% so I want to combine them using Decisiton tree so I want to know how to put the predication of the both Neural network and KNN to be the inputs for DT and how it is learned from both?

Accepted Answer

Greg Heath
Greg Heath on 8 Jul 2016
Since the accuracy rates are approximately equal, the easiest approach is to only make a decision when both classifiers agree.
Based on the results, you can decide how to break the tie when they disagree.
Hope this helps.
Thank you for formally accepting my answer
Greg
  2 Comments
essam
essam on 9 Jul 2016
thanks for reply, I actually made something like that, I got the model averaging approach , but I want to the stacking approach will be better,so hope I can know the way of doing it,
Greg Heath
Greg Heath on 10 Jul 2016
With {0,1} targets, your NN output will be an estimate of the input-conditional posterior probability. With a threshold, t: output >= t ==> the input belongs to class 1 otherwise it belongs to class 0.
An unbiased estimate of t and the corresponding error rate can be obtained from nontraining data. If N is sufficiently large, the validation subset is used to optimize the threshold and the test subset is used to obtain an unbiased error estimate.
When N is not sufficiently large, there are a variety of ways to limit error estimate bias. My top 2 favorites are crossvalidation (random and stratified).
Although KNN does not depend on a continuous threshold, t it does depend on the integer k. The optimal k can also be estimated via cross validation.
Since KNN is not a good estimate of posteriors, the best way to combine the results are via the classifications.
The only problem is to decide what to do when the classifiers disagree.
That is where your knowledge of the data plays a part.
Good Luck.
Hope this helps.
Greg

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!