LSH — hubness 0.21a1 documentation

# LSH

class `hubness.neighbors.` `LSH`(n_candidates: int = 5, radius: float = 1.0, metric: str = 'euclidean', num_probes: int = 50, n_jobs: int = 1, verbose: int = 0)

  Bases: `hubness.neighbors.approximate_neighbors.ApproximateNearestNeighbor`

  Attributes Summary

  `valid_metrics` |

  Methods Summary

  `fit`(X[, y]) | Setup the LSH index from training data.
  `kneighbors`([X, n_candidates, return_distance]) |
  `radius_neighbors`([X, radius, return_distance]) | TODO add docstring

  Attributes Documentation

  `valid_metrics` = ['euclidean', 'l2', 'minkowski', 'cosine', 'neg_inner', 'NegativeInnerProduct']

  Methods Documentation

  `fit`(X: numpy.ndarray, y: Optional[numpy.ndarray] = None) → hubness.neighbors.lsh.LSH

    Setup the LSH index from training data.

  `kneighbors`(X: Optional[numpy.ndarray] = None, n_candidates: Optional[int] = None, return_distance: bool = True)
  `radius_neighbors`(X: Optional[numpy.ndarray] = None, radius: Optional[float] = None, return_distance: bool = True)

    TODO add docstring

    Notes

    From the falconn docs: radius can be negative, and for the distance function ‘negative_inner_product’ it actually makes sense.