You can use zipWithIndex to get 1-up ids.

```scala
features.grouped(binSize).zipWithIndex.map { case (bin, idx) => buildBinnedFeature(bin, idx) }
```