Updating Bagging NN to use Immutable types for thread safety