zhengruifeng commented on pull request #29868:
URL: https://github.com/apache/spark/pull/29868#issuecomment-698693191


   repl:
   
   ```
   import org.apache.spark.ml.feature._
   import org.apache.spark.ml.linalg.{Vector, Vectors}
   val df = Seq((2.0, 1, "foo"),(3.0, 2, "bar")).toDF("real", "int", "string")
   val n = 100
   val hasher = new FeatureHasher().setInputCols("int", 
"string").setCategoricalCols(Array("real")).setOutputCol("features").setNumFeatures(n)
   hasher.transform(df).show
   ```
   
   
   
![image](https://user-images.githubusercontent.com/7322292/94221773-5b0e7f80-ff1e-11ea-98d8-e7a2f030c93b.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to