The indexing capability added.

The indexing is used for both prediction and cross validation tasks.