View VectorMean.scala
import org.apache.spark.ml.linalg.SQLDataTypes.VectorType | |
import org.apache.spark.ml.linalg.{Vector, Vectors} | |
import org.apache.spark.sql.Row | |
import org.apache.spark.sql.expressions.{MutableAggregationBuffer, UserDefinedAggregateFunction} | |
import org.apache.spark.sql.types._ | |
class VectorMean extends UserDefinedAggregateFunction { | |
// This is the input fields for your aggregate function. |