Hello, I am having this strange behaviour that I am trying to justify for more than a day now. Changing the value of an unused variable affects the results. Here is a snippet of the code:
model =fitensemble(bagging classification);
My model changes if I change the variable Number! What's going on? Is it possible that changing Number is somehow affecting fitensemble initialization? Also, when a specific Number is used, then the model is consistent whenever that Number is used!
EDIT: Here is a working code. In my original code a and b are some data, but using randn could replicate the problem. Please notice that if Number is changed, the model is changed. Roughly, sum(model.UseObsForLearner(:)) changes accordingly.
EDIT 2: I am getting closer. It has something to do with bagging. When I change from bagging to GentleBoost, the result is consistent and is not affected by the variable Number.