# `Latu.ML.Feature.BucketedRandomProjectionLSHModel`
[🔗](https://github.com/zero-one-group/latu_ml/blob/v0.4.2/lib/latu/ml/feature.ex#L0)

Attributes of a fitted `BucketedRandomProjectionLSHModel`.

Every accessor here is one name on the server's allowlist for
`org.apache.spark.ml.feature.BucketedRandomProjectionLSHModel` — 2 of them — so tab
completion is that allowlist. The server refuses anything else with
`CONNECT_ML.ATTRIBUTE_NOT_ALLOWED`; these refuse a model of the wrong class before it gets
that far, and name the module that would have taken it.

Allowed by the server but not here: `toString` is `Identifiable`'s, and tells you less than
the model's own uid. `Latu.ML.attribute/2` and `Latu.ML.attribute/3` will send any of these
names; it is what comes back that has nowhere to go.

The allowlist is inherited rather than per class: this one is the union of
`org.apache.spark.ml.feature.LSHModel`, `org.apache.spark.ml.util.Identifiable`.

# `approx_nearest_neighbors`

```elixir
@spec approx_nearest_neighbors(
  Latu.ML.Model.t(),
  Latu.DataFrame.t(),
  Nx.Tensor.t() | Latu.ML.SparseVector.t(),
  integer(),
  String.t() | atom()
) :: Latu.DataFrame.t()
```

Given a large dataset and an item, approximately find at most k items which have the closest
distance to the item. If the `outputCol` is missing, the method will transform the data; if
the `outputCol` exists, it will use that. This allows caching of the transformed data when
necessary.

A lazy builder: the `Fetch` rides a relation, so this hands back a `Latu.DataFrame` and
nothing has run until you collect it.

## Arguments

  * `dataset` — a `Latu.DataFrame`, sent as a relation rather than a literal
  * `key` — a Spark `Vector`: an `Nx.Tensor` or a `Latu.ML.SparseVector`
  * `num_nearest_neighbors` — an integer
  * `dist_col` — a string, or an atom

# `approx_similarity_join`

```elixir
@spec approx_similarity_join(
  Latu.ML.Model.t(),
  Latu.DataFrame.t(),
  Latu.DataFrame.t(),
  number(),
  String.t() | atom()
) :: Latu.DataFrame.t()
```

Join two datasets to approximately find all pairs of rows whose distance are smaller than
the threshold. If the `outputCol` is missing, the method will transform the data; if the
`outputCol` exists, it will use that. This allows caching of the transformed data when
necessary.

A lazy builder: the `Fetch` rides a relation, so this hands back a `Latu.DataFrame` and
nothing has run until you collect it.

## Arguments

  * `dataset_a` — a `Latu.DataFrame`, sent as a relation rather than a literal
  * `dataset_b` — a `Latu.DataFrame`, sent as a relation rather than a literal
  * `threshold` — a number, sent as a double
  * `dist_col` — a string, or an atom

# `class`

```elixir
@spec class() :: String.t()
```

The JVM class these accessors belong to.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
