Provides an extension method toKv to convert Options to Seq[(String, Double)].
This is used to coerce the value to the type that is used in regression models.
We don't do an implicit conversion method from Option[A] to Iterable[(String, Double)]
because it can negatively impact type inference. So we make the users convert explicitly
via:
val option: Option[Int] = Option(1)
val iterable = option.toKv
require(iterable == List(("", 1d)))
Provides an extension method toKv to convert Options to Seq[(String, Double)]. This is used to coerce the value to the type that is used in regression models. We don't do an implicit conversion method from Option[A] to Iterable[(String, Double)] because it can negatively impact type inference. So we make the users convert explicitly via:
the type of Option.