Home > other >  The Spark. Mllib ALS predictAll missing returns the result
The Spark. Mllib ALS predictAll missing returns the result

Time:09-19

Mission:
A recommendation system using mllib ALS do ratings estimate work
User training data about 2 w, item 60 w, 500 w scoring record
Test data about 11 w stay assessment points
Problem:
When using the test set to test the model. PredicAll return data is less than the test item
Part of the code is as follows (completed training before) :
 test_data=https://bbs.csdn.net/topics/sc.textFile (". \ data - new \ \ test ") 
Tdata=https://bbs.csdn.net/topics/test_data.map (lambda x: x.s plit (" \ t ") [2-0]). The map (lambda x: [int [0] (x), int [1] (x)])
Print (tdata. The count ())
# tgrade=model. PredictAll (tdata). Collect ()
Tgrade=model. PredictAll (tdata)
Print (tgrade. The count ())

On a piece of code output:
119010
117567
Less 1443 score, true don't understand why
I will pick out the missing item score again send in test results returned is an empty
If you have taught very grateful

CodePudding user response:

https://stackoverflow.com/questions/37379751/spark-als-predictall-returns-empty
  • Related