What is the output format of ALS model for method userFeatures or productFeatures in MLLib library?
<p>I have a rating data set like this: (userId,itemId,rating)</p>

<pre><code>1 100 4
1 101 5
1 102 3
1 10 3
1 103 5
4 353 2
4 354 4
4 355 5
7 420 5
7 421 4
7 422 4
</code></pre>

<p>I'm trying to use ALS method to construct a matrix factorization model to obtain user latent features and product latent features by this code:</p>

<pre><code>object AlsTest {
       def main(args: Array[String])
 {
   System.setProperty("hadoop.home.dir","C:\\spark-1.5.1-bin-hadoop2.6\\winutil")
   val conf = new SparkConf().setAppName("test").setMaster("local[4]")
   val sc = new SparkContext(conf)

   // Load and parse the data

val data = sc.textFile("ratings.txt")
val ratings = data.map(_.split(" ") match { case Array(user, item, rate) =&gt;
  Rating(user.toInt, item.toInt, rate.toDouble)
})

// Build the recommendation model using ALS
val rank =10
val numIterations =30
val model = ALS.train(ratings, rank, numIterations, 0.01)


val a = model.productFeatures().cache().collect.foreach(println)                         //.cache().collect.count()//.collect.foreach(println)
</code></pre>

<p>I have set the rank equal 10, and out put format for model.productFeatures() should be a RDD:[(int,Array[Double])] but when I see the out put there is some problems, there are some characters in output(what are these characters) and the number of Array elements in records is different, these are latent features values and counts of them in every records must be equal also,these aren't ten ,exactly equal to rank number. out put is like this:</p>

<pre><code>(48791,7fea9bb7)
(48795,284b451d)
(48799,3d64767d)
(48803,2f812fc3)
(48807,49d3ea7)
(48811,768cf084)
(48815,6845b7b6)
(48819,4e9c724a)
(48823,23191538)
(48827,3200d90f)
(48831,77bd30fe)
(48839,5a1e0261)
(48843,31c56ccf)
(48855,5b90359)
(48863,1b9de9d0)
(48867,313afdc8)
(48871,2b834c34)
(48875,666d21d6)
(48891,12ca97a2)
(48907,74f8fc8e)
(48911,452becc9)
(48915,4a47062b)
(48919,c76ef46)
(48923,3f596eca)
(48927,258e904c)
(48939,570abc88)
(48947,6c3d75f0)
(48951,18667983)
(48955,493b9633)
(48959,4b579d60)
</code></pre>

<p>in matrix factorization we should construct two matrix with lower dimensions so that multiply them equal to rating matrix: </p>

<pre><code>rating matrix= p*q(transpose), 
p= user latent feature matrix,
q= product latent features matrix,
</code></pre>

<p>can any one explain about the out put format of als methods in spark?</p>