Skip to content

Commit

Permalink
Added scala function to stringify userFeatures for access in python.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michelangelo D'Agostino committed Oct 2, 2014
1 parent d3a3840 commit e1fbe5e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,8 @@ class MatrixFactorizationModel private[mllib] (
}
scored.top(num)(Ordering.by(_._2))
}

def userFeaturesString(userFeatures: RDD[(Int, Array[Double])]): RDD[String] = {
userFeatures.map(element => element._1+","+element._2.mkString(","))
}
}

0 comments on commit e1fbe5e

Please sign in to comment.