Comments (5)
I am also looking for solution to save model using scala spark
from spark-knn.
I also had this problem,does it any solution for it?
from spark-knn.
I've tried like this:
sc.parallelize(Seq(knnModel), 1).saveAsObjectFile("/user/you/knnTest/" + "KNN")
val model = sc.objectFile[KNNClassificationModel]("/user/you/knnTest/" + "KNN").first()
but the model pulled back in no longer seems to work, which is strange since this has worked for all my other models.
from spark-knn.
I also encountered this problem. I attempted to serialize this model and load again. but rdd[tree] cannot be deserialized correctly. it looks like that metricTree have some problem. if you have sollution,comment please
from spark-knn.
Also saving using PipelineModel.save() does not work:
Caused by: java.lang.UnsupportedOperationException: Pipeline write will fail on this Pipeline because it contains a stage which does not implement Writable. Non-Writable stage: knnc_95d9ce15f990 of type class org.apache.spark.ml.classification.KNNClassificationModel
at org.apache.spark.ml.Pipeline$SharedReadWrite$$anonfun$validateStages$1.apply(Pipeline.scala:231)
at org.apache.spark.ml.Pipeline$SharedReadWrite$$anonfun$validateStages$1.apply(Pipeline.scala:228)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at org.apache.spark.ml.Pipeline$SharedReadWrite$.validateStages(Pipeline.scala:228)
at org.apache.spark.ml.PipelineModel$PipelineModelWriter.<init>(Pipeline.scala:336)
at org.apache.spark.ml.PipelineModel.write(Pipeline.scala:320)
at org.apache.spark.ml.util.MLWritable$class.save(ReadWrite.scala:306)
at org.apache.spark.ml.PipelineModel.save(Pipeline.scala:293)
... 16 more
from spark-knn.
Related Issues (20)
- Problem with MNIST.scala example HOT 3
- Getting K nearest neighbor for each data point HOT 2
- Sparse Vectors?
- knn.fit(training) throws an exception HOT 10
- KNN set tree size and sub tree size and leave size
- TypeError: 'JavaPackage' object is not callable HOT 1
- Does this implementation support hundreds of millions points? HOT 2
- java.lang.NoSuchMethodError:breeze.linalg.Vector$.scalaOf() Lbreeze/linalg/support/ScalaOf HOT 1
- value transform in class KNNRegression cannot be accessed in org.apache.spark.ml.regression.KNNRegression
- Searching K nearest neighbors for each test sample in training set HOT 1
- Algorithm fails on small data
- Exception occurred when initializing new KNNRegression() HOT 6
- Release version for Spark 2.4.X / Scala 2.12
- offline use in pyspark2.3.3 HOT 3
- issue with running using spark-sumbit
- How to use it in pyspark environment
- Nearest Neighbor between two dataframes HOT 3
- How to get the exact nearest neighbors? HOT 1
- Got "Caused by: java.lang.ArrayStoreException" when running KNN
- Can not download the dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark-knn.