Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions mllib/src/main/scala/org/apache/spark/ml/feature/LSH.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ private[ml] trait LSHParams extends HasInputCol with HasOutputCol {
* higher the dimension is, the lower the false negative rate.
* @group param
*/
final val outputDim: IntParam = new IntParam(this, "outputDim", "output dimension, where" +
"increasing dimensionality lowers the false negative rate, and decreasing dimensionality" +
" improves the running performance", ParamValidators.gt(0))
final val outputDim: IntParam = new IntParam(this, "outputDim", "The output dimension, where" +
" increasing dimensionality lowers the false negative rate, and decreasing dimensionality" +
" improves the running performance.", ParamValidators.gt(0))

/** @group getParam */
final def getOutputDim: Int = $(outputDim)
Expand Down Expand Up @@ -109,11 +109,11 @@ private[ml] abstract class LSHModel[T <: LSHModel[T]]
* - Single Probing: Fast, return at most k elements (Probing only one buckets)
* - Multiple Probing: Slow, return exact k elements (Probing multiple buckets close to the key)
*
* @param dataset the dataset to search for nearest neighbors of the key
* @param key Feature vector representing the item to search for
* @param numNearestNeighbors The maximum number of nearest neighbors
* @param singleProbing True for using Single Probing; false for multiple probing
* @param distCol Output column for storing the distance between each result row and the key
* @param dataset The dataset to search for nearest neighbors of the key.
* @param key Feature vector representing the item to search for.
* @param numNearestNeighbors The maximum number of nearest neighbors.
* @param singleProbing True for using Single Probing; false for multiple probing.
* @param distCol Output column for storing the distance between each result row and the key.
* @return A dataset containing at most k items closest to the key. A distCol is added to show
* the distance between each row and the key.
*/
Expand Down Expand Up @@ -215,12 +215,12 @@ private[ml] abstract class LSHModel[T <: LSHModel[T]]
* [[outputCol]] exists, it will use the [[outputCol]]. This allows caching of the transformed
* data when necessary.
*
* @param datasetA One of the datasets to join
* @param datasetB Another dataset to join
* @param threshold The threshold for the distance of row pairs
* @param distCol Output column for storing the distance between each result row and the key
* @param datasetA One of the datasets to join.
* @param datasetB Another dataset to join.
* @param threshold The threshold for the distance of row pairs.
* @param distCol Output column for storing the distance between each result row and the key.
* @return A joined dataset containing pairs of rows. The original rows are in columns
* "datasetA" and "datasetB", and a distCol is added to show the distance of each pair
* "datasetA" and "datasetB", and a distCol is added to show the distance of each pair.
*/
def approxSimilarityJoin(
datasetA: Dataset[_],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import org.apache.spark.sql.types.StructType
*
* Model produced by [[MinHash]], where multiple hash functions are stored. Each hash function is
* a perfect hash function:
* `h_i(x) = (x * k_i mod prime) mod numEntries`
* where `k_i` is the i-th coefficient, and both `x` and `k_i` are from `Z_prime^*`
* `h_i(x) = (x * k_i \mod prime) \mod numEntries`
* where `k_i` is the i-th coefficient, and both `x` and `k_i` are from `Z_{prime^*}`
*
* Reference:
* [[https://en.wikipedia.org/wiki/Perfect_hash_function Wikipedia on Perfect Hash Function]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private[ml] trait RandomProjectionParams extends Params {
*
* Model produced by [[RandomProjection]], where multiple random vectors are stored. The vectors
* are normalized to be unit vectors and each vector is used in a hash function:
* `h_i(x) = floor(r_i.dot(x) / bucketLength)`
* `h_i(x) = floor(r_i * x / bucketLength)`
* where `r_i` is the i-th random unit vector. The number of buckets will be `(max L2 norm of input
* vectors) / bucketLength`.
*
Expand Down
Loading