4 ms·
Wait, Spark has built-in Model Hyperparameter selection (http://spark.apache.org/docs/latest/ml-tuning.html http://spark.apache.org/docs/latest/ml-tuning.html),
by minimaxir 10y ago
Wait, Spark has built-in Model Hyperparameter selection (http://spark.apache.org/docs/latest/ml-tuning.html http://spark.apache.org/docs/latest/ml-tuning.html), that was not mentioned in the article. What advantages does your service do?
Relatedly, why are you advocating using MLLib/RDDs when they have been deprecated in favor of ML/DataFrames (http://spark.apache.org/docs/latest/ml-guide.html http://spark.apache.org/docs/latest/ml-guide.html)?
- Zephyr314 10y agoGreat questions! The Spark hyperparameter selection uses an exhaustive grid search approach, which can take a long time (complexity grows exponentially with number of parameters to tune) and produce poor results when compared to other methods [1]. Bayesian optimization is a great way to tune time consuming and expensive functions like ML pipelines, where finding a good configuration in a small number of total attempts is the only tractable way to tune the system. ALS implementation in MLLib still requires ratings in RDD and hasn't moved over to ML/DataFrames yet. Edit: Looks like the original comment was edited, but this post does in fact use the built in MLlib ALS implementation. [1]: http://arxiv.org/abs/1603.09441 http://arxiv.org/abs/1603.09441
- minimaxir 10y ago> ALS implementation in MLLib still requires ratings in RDD and hasn't moved over to ML/DataFrames yet. ALS has been available in ML/DataFrames since 1.3.0, per the documentation. (http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.ml.recommendation.ALS http://spark.apache.org/docs/latest/api/scala/index.html#org...) > Edit: Looks like the original comment was edited, but this post does in fact use the built in MLlib cross validation methods. I edited the comment to correct my error that ALS was not mentioned as being native to Spark. However, for Hyperparameter cross validation, I looked at the code in the repository (https://github.com/sigopt/sigopt-examples/blob/master/spark/recommender_sys/src/main/scala/MovieLense.scala https://github.com/sigopt/sigopt-examples/blob/master/spark/...), and while the Spark CrossValidation function is imported at the beginning of the Scala file (from ML, not MLlib), it is not used in the code, in favor of SigOpt. I'm confused.
- idewanck 10y agoThanks for pointing out the switch away from RDD, looking at the master branch for MLlib in github it looks like ALS is still using RDDs? https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala https://github.com/apache/spark/blob/master/mllib/src/main/s... Admittedly I'm not a spark expert though, thanks for bringing this up!
- minimaxir 10y agoMLlib is for operating in RDDs, ML is for operating in DataFrames. RDDs themselves, however, are obsolete to DataFrames as DataFrames are faster and cover most of the functionality of RDDs for common use cases.
- Zephyr314 10y agoThanks for the heads up! We'll make sure to use DataFrames in our next Spark example. As mentioned before, we thought this would be a cool application of Bayesian optimization (especially since the Spark docs advocate the exponentially slower grid search approach as you pointed out), but we are not Spark experts. We appreciate the feedback!
- kod 10y agoRDDs are not obsolete. The reason dataframes are faster is exactly because they are more restrictive than RDDs. If you need to run arbitrary code, RDDs are stil more flexible.
- lern_too_spel 10y agoUnder the hood, all the existing (as of 2.0) ML pipelines models immediately convert the Dataframe to an RDD and cache it, so there is a one iteration slowdown for using the Dataframe models versus an equivalently implemented RDD model. None of them try to get a speedup by directly operating on the Tungsten datastructure, but it is an obvious next step.
- nl 10y agoRelatedly, why are you advocating using MLLib/RDDs when they have been deprecated in favor of ML/DataFrames (http://spark.apache.org/docs/latest/ml-guide.html http://spark.apache.org/docs/latest/ml-guide.html)? Note that the DataFrame version of MLLib (which is still called MLLib btw, even if the package is different) isn't feature complete compared to the RDD version. For example, the DataFrame version of LogisticRegression is binary only, while the RDD one allows multiple classes. I guess the suggested work around is to use the OneVsRest classifier (in Spark 2.0), but that blows the memory out on fairly small tasks. I like Spark a lot, but MLLib isn't as strong as it appears at first glance.