Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/10327#discussion_r48503471
--- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/PCA.scala ---
@@ -167,14 +167,37 @@ object PCAModel extends MLReadable[PCAModel] {
private val className = classOf[PCAModel].getName
+ /**
+ * Loads a [[PCAModel]] from data located at the input path. Note that
the model includes an
+ * `explainedVariance` member that is not recorded by Spark 1.6 and
earlier. A model
+ * can be loaded from such older data but will have an empty vector for
+ * `explainedVariance`.
+ *
+ * @param path path to serialized model data
+ * @return a [[PCAModel]]
+ */
override def load(path: String): PCAModel = {
val metadata = DefaultParamsReader.loadMetadata(path, sc, className)
+
+ // explainedVariance field is not present in Spark <= 1.6
+ val versionRegex = "([0-9]+)\\.([0-9])+.*".r
--- End diff --
Oh shoot, typo. It won't matter anytime soon but yes that's not quite
correct.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]