If all of the ensemble members should be trained on the same training data the training method should be able to take only the training x and y data rather than lists of the same training and test data. This would reduce confusion and memory footprint.
That is,
ensemble.train([trainx for _ in range(nummodels)], [trainy for in range(num_models)])
This would also prevent having to update the num_models variable in the train call when adding new models to the ensemble as all members would just use the same passed data.
If all of the ensemble members should be trained on the same training data the training method should be able to take only the training x and y data rather than lists of the same training and test data. This would reduce confusion and memory footprint.
That is,
ensemble.train([trainx for _ in range(nummodels)], [trainy for in range(num_models)])
would become
ensemble.train(trainx, trainy)