但是集群spark1.0.2平台已搭好,不方便再升级了。所以我们最后的方法是利用对象序列化储存搞定了[存储model]:
val serial_out = new ObjectOutputStream(new FileOutputStream("svm_model.obj"))
serial_out.writeObject(model)
serial_out.close()
[加载model:]
val serial_in = new ObjectInputStream(new FileInputStream("svm_model.obj"))
val saved_model = serial_in.readObject().asInstanceOf[SVMModel]