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

    https://github.com/apache/spark/pull/12498#discussion_r60239341
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/feature/HashingTF.scala ---
    @@ -54,20 +60,43 @@ class HashingTF(val numFeatures: Int) extends 
Serializable {
       }
     
       /**
    +   * Set the hash algorithm used when mapping term to integer.
    +   * (default: murmur3)
    +   */
    +  @Since("2.0.0")
    +  def setHashAlgorithm(value: String): this.type = {
    +    hashAlgorithm = value
    +    this
    +  }
    +
    +  /**
        * Returns the index of the input term.
        */
       @Since("1.1.0")
    +  @deprecated("Use indexOfTerm instead. This method will be removed in 
2.1.0.", "2.0.0")
       def indexOf(term: Any): Int = Utils.nonNegativeMod(term.##, numFeatures)
     
       /**
    +   * Returns the index of the input term by different hash algorithms.
    +   */
    +  @Since("2.0.0")
    +  def indexOfTerm(hashAlgorithm: String)(term: Any): Int = {
    --- End diff --
    
    Because users may update ```hashAlgorithm``` by ```setHashAlgorithm``` 
after it first generated, so we should determinate the algorithm used at 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 [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