Yes, the ChunkSample class is immutable and needs to encapsulate the arrays. If it would just hand out the array someone could modify it, but this we do not want.

It its always good to have immutable classes, but yes it is slower since we need to make two copies just to ensure that. In the end I think we do not loose much time here during training. Immutable object are also thread safe which will be important as soon as
we have multi-threaded training code.

These ArrayLists actually are quite nice if you have to do this conversions, because they
bring very well tested methods for that. So that is why I used them.

Jörn

Reply via email to