0

I know through spark-mllib we can save naive bayes model to hdfs by save() method . But we I try with spark-ml naive bayes to save into hdfs then it giving error . Wrong FS: hdfs://localhost:8020/pa/model/nb, expected: file:///

I am using spark-1.6.0 and hadoop 2.7 .

mahendra singh
  • 384
  • 1
  • 13

1 Answers1

1

I've also had problems saving spark-ml models - there doesn't seem to be a straightforward way to do this.

Try saving it like this - if you are getting an error with the path, try saving it to tmp, like below.

sc.parallelize(Seq(NBmodel), 1).saveAsObjectFile(“/tmp/NBModel”)
other15
  • 839
  • 2
  • 11
  • 23