I finally solved the problem by following code 

var m: org.apache.spark.mllib.classification.LogisticRegressionModel = null

m = newModel   // newModel is the loaded one, see above post of mine

val labelsAndPredsOnGoodData = goodDataPoints.map { point =>
  val prediction = m.predict(point.features)
  (point.label, prediction)
}  // this works!

Thanks  Shixiong for his heuristic codes which lead me to this solution.

btw, accoring to this  git commit
<https://www.mail-archive.com/commits@spark.apache.org/msg01988.html>  ,
private[mllib] will be removed  from linear models' constructors,"This is
part of SPARK-2495 to allow users construct linear models manually"



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/How-to-save-mllib-model-to-hdfs-and-reload-it-tp11953p12154.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to