I am using Adaboost to fit a classification problem. We can do the following:
ens = fitensemble(X, Y, 'AdaBoostM1', 100, 'Tree')
Now 'Tree' is the learner and we can change this to 'Discriminant' or 'KNN'. Each learner uses a certain Template Object Creation Function
. More info here.
Is it possible to create your own function and use it as a learner? And how?
I open templateTree.m and templateKNN.m to see how MATLAB define Template Object Creation Function.
and
It shows that MATLAB has a function in FitTemplate named make , if you open this m-file, you will see :
You must change this function.