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

    https://github.com/apache/spark/pull/15874#discussion_r87906309
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/MinHashLSH.scala 
---
    @@ -46,21 +42,23 @@ import org.apache.spark.sql.types.StructType
     @Since("2.1.0")
     class MinHashModel private[ml] (
         override val uid: String,
    -    @Since("2.1.0") val numEntries: Int,
    -    @Since("2.1.0") val randCoefficients: Array[Int])
    +    @Since("2.1.0") private[ml] val numEntries: Int,
    +    @Since("2.1.0") private[ml] val randCoefficients: Array[Int])
       extends LSHModel[MinHashModel] {
     
       @Since("2.1.0")
    -  override protected[ml] val hashFunction: Vector => Vector = {
    -    elems: Vector =>
    +  override protected[ml] val hashFunction: Vector => Array[Vector] = {
    +    elems: Vector => {
           require(elems.numNonzeros > 0, "Must have at least 1 non zero 
entry.")
           val elemsList = elems.toSparse.indices.toList
           val hashValues = randCoefficients.map({ randCoefficient: Int =>
    -          elemsList.map({elem: Int =>
    -            (1 + elem) * randCoefficient.toLong % MinHash.prime % 
numEntries
    -          }).min.toDouble
    +        elemsList.map({ elem: Int =>
    --- End diff --
    
    redundant brackets. Just use `elemsList.map { elem: Int =>`


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