You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mengxr <gi...@git.apache.org> on 2015/02/06 09:25:18 UTC

[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

GitHub user mengxr opened a pull request:

    https://github.com/apache/spark/pull/4422

    [SPARK-5598][MLLIB] model save/load for ALS

    following #4233. @jkbradley

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mengxr/spark SPARK-5598

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/4422.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4422
    
----
commit 62fc43c7f91704f23d448d58872755a0e1743274
Author: Xiangrui Meng <me...@databricks.com>
Date:   2015-02-06T07:34:33Z

    implement save/load for MFM

commit 10892efec3d7e01208537549c6c7c1be0a8a6684
Author: Xiangrui Meng <me...@databricks.com>
Date:   2015-02-06T08:22:48Z

    add unit tests

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73377111
  
      [Test build #27007 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/27007/consoleFull) for   PR 4422 at commit [`ba1ab4e`](https://github.com/apache/spark/commit/ba1ab4e3820412bb8fded974488c272292bfcd7b).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24276831
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -136,3 +147,69 @@ class MatrixFactorizationModel(
         scored.top(num)(Ordering.by(_._2))
       }
     }
    +
    +private object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] {
    +
    +  import org.apache.spark.mllib.util.Loader._
    +
    +  override def load(sc: SparkContext, path: String): MatrixFactorizationModel = {
    +    val (loadedClassName, formatVersion, metadata) = loadMetadata(sc, path)
    +    val classNameV1_0 = SaveLoadV1_0.thisClassName
    +    (loadedClassName, formatVersion) match {
    +      case (className, "1.0") if className == classNameV1_0 =>
    +        SaveLoadV1_0.load(sc, path)
    +      case _ =>
    +        throw new IOException("" +
    +          "MatrixFactorizationModel.load did not recognize model with" +
    +          s"(class: $loadedClassName, version: $formatVersion). Supported:\n" +
    +          s"  ($classNameV1_0, 1.0)")
    +    }
    +  }
    +
    +  private object SaveLoadV1_0 extends Loader[MatrixFactorizationModel] {
    --- End diff --
    
    This should be okay. It is indeed a Loader, so I can omit the doc of `load` ....


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73211195
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26907/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73334663
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26959/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73326743
  
      [Test build #26964 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26964/consoleFull) for   PR 4422 at commit [`14b7ea6`](https://github.com/apache/spark/commit/14b7ea65addd05d166a835280c9a6827c4c33788).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/4422


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24263522
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -125,6 +130,12 @@ class MatrixFactorizationModel(
         recommend(productFeatures.lookup(product).head, userFeatures, num)
           .map(t => Rating(t._1, product, t._2))
     
    +  override val formatVersion: String = "1.0"
    --- End diff --
    
    protected


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73442465
  
    Merged into master and branch-1.3.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73377401
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27007/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73334655
  
      [Test build #26959 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26959/consoleFull) for   PR 4422 at commit [`2622870`](https://github.com/apache/spark/commit/2622870f1d2bb7221ca80b3421278b1d3ce9cafe).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `      "public class " + className + " implements java.io.Serializable `
      * `  case class RegisterExecutor(executorId: String, hostPort: String, cores: Int)`
      * `          throw new SparkException("Failed to load class to register with Kryo", e)`
      * `class LogisticRegression extends Estimator[LogisticRegressionModel] with LogisticRegressionParams `
      * `class DoubleParam(parent: Params, name: String, doc: String, defaultValue: Option[Double] = None)`
      * `class IntParam(parent: Params, name: String, doc: String, defaultValue: Option[Int] = None)`
      * `class FloatParam(parent: Params, name: String, doc: String, defaultValue: Option[Float] = None)`
      * `class LongParam(parent: Params, name: String, doc: String, defaultValue: Option[Long] = None)`
      * `class BooleanParam(parent: Params, name: String, doc: String, defaultValue: Option[Boolean] = None)`
      * `  class EMOptimizer(`
      * `case class GetField(child: Expression, fieldName: String) extends UnaryExpression `
      * `class DefaultSource extends RelationProvider `
      * `case class ParquetRelation2(path: String)(@transient val sqlContext: SQLContext)`
      * `protected class CaseInsensitiveMap(map: Map[String, String]) extends Map[String, String] `
      * `trait CreateableRelationProvider `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73323713
  
    This is the `spark.mllib` package. We don't expect users to use Spark SQL here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73211185
  
      [Test build #26907 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26907/consoleFull) for   PR 4422 at commit [`f487cb2`](https://github.com/apache/spark/commit/f487cb216fdfddbd12772456f277ccbb1bb7a116).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24263210
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -136,3 +147,69 @@ class MatrixFactorizationModel(
         scored.top(num)(Ordering.by(_._2))
       }
     }
    +
    +private object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] {
    +
    +  import org.apache.spark.mllib.util.Loader._
    +
    +  override def load(sc: SparkContext, path: String): MatrixFactorizationModel = {
    +    val (loadedClassName, formatVersion, metadata) = loadMetadata(sc, path)
    +    val classNameV1_0 = SaveLoadV1_0.thisClassName
    +    (loadedClassName, formatVersion) match {
    +      case (className, "1.0") if className == classNameV1_0 =>
    +        SaveLoadV1_0.load(sc, path)
    +      case _ =>
    +        throw new IOException("" +
    --- End diff --
    
    Is this the preferred syntax?  I've been wondering about this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73381463
  
      [Test build #27011 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/27011/consoleFull) for   PR 4422 at commit [`a059394`](https://github.com/apache/spark/commit/a0593947822ed3294881c0b23d8b8a83ff2aee62).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73326856
  
    Other than the Loader issue, looks good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73202406
  
      [Test build #26907 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26907/consoleFull) for   PR 4422 at commit [`f487cb2`](https://github.com/apache/spark/commit/f487cb216fdfddbd12772456f277ccbb1bb7a116).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73326812
  
    Having SaveLoadV1_0 be a Loader is weird since it loads metadata, and the metadata gives the version number.  It works now since there is only 1 version, but it will have to stop being a Loader in the future.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24267412
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -136,3 +147,69 @@ class MatrixFactorizationModel(
         scored.top(num)(Ordering.by(_._2))
       }
     }
    +
    +private object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] {
    +
    +  import org.apache.spark.mllib.util.Loader._
    +
    +  override def load(sc: SparkContext, path: String): MatrixFactorizationModel = {
    +    val (loadedClassName, formatVersion, metadata) = loadMetadata(sc, path)
    +    val classNameV1_0 = SaveLoadV1_0.thisClassName
    +    (loadedClassName, formatVersion) match {
    +      case (className, "1.0") if className == classNameV1_0 =>
    +        SaveLoadV1_0.load(sc, path)
    +      case _ =>
    +        throw new IOException("" +
    --- End diff --
    
    I assume it's to make the lines below line up


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24266304
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -136,3 +147,69 @@ class MatrixFactorizationModel(
         scored.top(num)(Ordering.by(_._2))
       }
     }
    +
    +private object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] {
    +
    +  import org.apache.spark.mllib.util.Loader._
    +
    +  override def load(sc: SparkContext, path: String): MatrixFactorizationModel = {
    +    val (loadedClassName, formatVersion, metadata) = loadMetadata(sc, path)
    +    val classNameV1_0 = SaveLoadV1_0.thisClassName
    +    (loadedClassName, formatVersion) match {
    +      case (className, "1.0") if className == classNameV1_0 =>
    +        SaveLoadV1_0.load(sc, path)
    +      case _ =>
    +        throw new IOException("" +
    --- End diff --
    
    Here can't you just omit the `"" +`? maybe it was just auto-inserted by the IDE on hitting return there.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73377399
  
      [Test build #27007 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/27007/consoleFull) for   PR 4422 at commit [`ba1ab4e`](https://github.com/apache/spark/commit/ba1ab4e3820412bb8fded974488c272292bfcd7b).
     * This patch **fails to build**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24263529
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -136,3 +147,69 @@ class MatrixFactorizationModel(
         scored.top(num)(Ordering.by(_._2))
       }
     }
    +
    +private object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] {
    +
    +  import org.apache.spark.mllib.util.Loader._
    +
    +  override def load(sc: SparkContext, path: String): MatrixFactorizationModel = {
    +    val (loadedClassName, formatVersion, metadata) = loadMetadata(sc, path)
    +    val classNameV1_0 = SaveLoadV1_0.thisClassName
    +    (loadedClassName, formatVersion) match {
    +      case (className, "1.0") if className == classNameV1_0 =>
    +        SaveLoadV1_0.load(sc, path)
    +      case _ =>
    +        throw new IOException("" +
    +          "MatrixFactorizationModel.load did not recognize model with" +
    +          s"(class: $loadedClassName, version: $formatVersion). Supported:\n" +
    +          s"  ($classNameV1_0, 1.0)")
    +    }
    +  }
    +
    +  private object SaveLoadV1_0 extends Loader[MatrixFactorizationModel] {
    --- End diff --
    
    Does not need to extend Loader


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73324593
  
      [Test build #26959 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26959/consoleFull) for   PR 4422 at commit [`2622870`](https://github.com/apache/spark/commit/2622870f1d2bb7221ca80b3421278b1d3ce9cafe).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24276825
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -136,3 +147,69 @@ class MatrixFactorizationModel(
         scored.top(num)(Ordering.by(_._2))
       }
     }
    +
    +private object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] {
    --- End diff --
    
    nice catch


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24276821
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -136,3 +147,69 @@ class MatrixFactorizationModel(
         scored.top(num)(Ordering.by(_._2))
       }
     }
    +
    +private object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] {
    +
    +  import org.apache.spark.mllib.util.Loader._
    +
    +  override def load(sc: SparkContext, path: String): MatrixFactorizationModel = {
    +    val (loadedClassName, formatVersion, metadata) = loadMetadata(sc, path)
    +    val classNameV1_0 = SaveLoadV1_0.thisClassName
    +    (loadedClassName, formatVersion) match {
    +      case (className, "1.0") if className == classNameV1_0 =>
    +        SaveLoadV1_0.load(sc, path)
    +      case _ =>
    +        throw new IOException("" +
    --- End diff --
    
    Yes, that's was from IDE.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73381467
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27011/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73333438
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26964/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24276828
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -125,6 +130,12 @@ class MatrixFactorizationModel(
         recommend(productFeatures.lookup(product).head, userFeatures, num)
           .map(t => Rating(t._1, product, t._2))
     
    +  override val formatVersion: String = "1.0"
    --- End diff --
    
    done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73333421
  
      [Test build #26964 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26964/consoleFull) for   PR 4422 at commit [`14b7ea6`](https://github.com/apache/spark/commit/14b7ea65addd05d166a835280c9a6827c4c33788).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73294709
  
    I just had a few small comments.  One question which occurred to me: Does SQLContext have configuration info which would be relevant to saving/loading?  I'm wondering if users should be able to pass in a SQLContext to save/load.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4422#discussion_r24263497
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala ---
    @@ -136,3 +147,69 @@ class MatrixFactorizationModel(
         scored.top(num)(Ordering.by(_._2))
       }
     }
    +
    +private object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] {
    --- End diff --
    
    not private


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-5598][MLLIB] model save/load for ALS

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/4422#issuecomment-73378449
  
      [Test build #27011 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/27011/consoleFull) for   PR 4422 at commit [`a059394`](https://github.com/apache/spark/commit/a0593947822ed3294881c0b23d8b8a83ff2aee62).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org