I want to make libsvm format, so I made dataframe to the desired format, but I do not know how to convert to libsvm format. The format is as shown in the figure. I hope that
In order to convert an existing to a typed DataSet I suggest the following; Use the following case class:
DataSet
case class LibSvmEntry ( value: Double, features: L.Vector)
The you can use the map function to convert it to a LibSVM entry like so: df.map[LibSvmEntry](r: Row => /* Do your stuff here*/)
map
df.map[LibSvmEntry](r: Row => /* Do your stuff here*/)