spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbtsai <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-5207] [MLLIB] StandardScalerModel mean ...
Date Tue, 27 Jan 2015 01:14:42 GMT
Github user dbtsai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4140#discussion_r23580058
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/feature/StandardScaler.scala ---
    @@ -61,20 +61,34 @@ class StandardScaler(withMean: Boolean, withStd: Boolean) extends
Logging {
      * :: Experimental ::
      * Represents a StandardScaler model that can transform vectors.
      *
    - * @param withMean whether to center the data before scaling
    - * @param withStd whether to scale the data to have unit standard deviation
      * @param mean column mean values
      * @param variance column variance values
    + * @param withMean whether to center the data before scaling
    + * @param withStd whether to scale the data to have unit standard deviation
      */
     @Experimental
    -class StandardScalerModel private[mllib] (
    -    val withMean: Boolean,
    -    val withStd: Boolean,
    +class StandardScalerModel (
         val mean: Vector,
    -    val variance: Vector) extends VectorTransformer {
    +    val variance: Vector,
    +    var withMean: Boolean,
    +    var withStd: Boolean) extends VectorTransformer {
     
       require(mean.size == variance.size)
     
    +  def this(mean: Vector, variance: Vector) {
    +    this(mean, variance, false, true)
    +  }
    +
    --- End diff --
    
    Sounds reasonable for me. Although the changes will be larger, this will be more handy
and save extra space if withMean is not used.


---
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


Mime
View raw message