Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7150#discussion_r37000959
  
    --- Diff: python/pyspark/ml/feature.py ---
    @@ -1030,6 +1030,87 @@ class Word2VecModel(JavaModel):
         """
     
     
    +@inherit_doc
    +class MinMaxScaler(JavaEstimator, HasInputCol, HasOutputCol):
    +    """
    +    Rescale each feature individually to a common range [min, max] 
linearly using column summary
    +    statistics, which is also known as min-max normalization or Rescaling. 
The rescaled value for
    +    feature E is calculated as,
    +
    +    Rescaled(e_i) = \frac{e_i - E_{min}}{E_{max} - E_{min}} * (max - min) 
+ min
    +
    +    For the case E_{max} == E_{min}, Rescaled(e_i) = 0.5 * (max + min)
    +
    +    >>> from pyspark.mllib.linalg import Vectors
    +    >>> df = sqlContext.createDataFrame([(Vectors.dense([0.0]),), 
(Vectors.dense([2.0]),)], ["a"])
    +    >>> mmScaler = MinMaxScaler(inputCol="a", outputCol="scaled")
    +    >>> model = mmScaler.fit(df)
    +    >>> model.transform(df).collect()[1].scaled
    --- End diff --
    
    Can you please change this to model.transform(df).show()?  That looks nice 
(and is Ok for 2 rows).


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

Reply via email to