hubness.neighbors API — hubness 0.21a1 documentation

# hubness.neighbors API

## hubness.neighbors Package

The `hubness.neighbors` module implements the (hubness reduced) k-nearest neighbors algorithm.

### Functions

`kneighbors_graph`(X, n_neighbors[, mode, …]) | Computes the (weighted) graph of k-Neighbors for points in X
`radius_neighbors_graph`(X, radius[, mode, …]) | Computes the (weighted) graph of Neighbors for points in X

### Classes

`BallTree` | BallTree for fast generalized N-point problems
`DistanceMetric` | DistanceMetric class
`KDTree` | KDTree for fast generalized N-point problems
`HNSW`([n_candidates, metric, method, …]) |
`KNeighborsClassifier`([n_neighbors, weights, …]) | Classifier implementing the k-nearest neighbors vote.
`KNeighborsRegressor`([n_neighbors, weights, …]) | Regression based on k-nearest neighbors.
`LSH`([n_candidates, radius, metric, …]) |
`NearestCentroid`([metric, shrink_threshold]) | Nearest centroid classifier.
`NearestNeighbors`([n_neighbors, radius, …]) | Unsupervised learner for implementing neighbor searches.
`RadiusNeighborsClassifier`([radius, weights, …]) | Classifier implementing a vote among neighbors within a given radius Read more in the User Guide.
`RadiusNeighborsRegressor`([radius, weights, …]) | Regression based on neighbors within a fixed radius.
`KernelDensity`([bandwidth, algorithm, …]) | Kernel Density Estimation
`LocalOutlierFactor`([n_neighbors, algorithm, …]) | Unsupervised Outlier Detection using Local Outlier Factor (LOF)
`NeighborhoodComponentsAnalysis`([…]) | Neighborhood Components Analysis

### Class Inheritance Diagram

digraph inheritance1db0dba9d5 { rankdir=LR; size="8.0, 12.0"; "ABC" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Helper class that provides a standard way to create an ABC using"]; "ApproximateNearestNeighbor" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Abstract base class for approximate nearest neighbor search methods."]; "ABC" -> "ApproximateNearestNeighbor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BaseEstimator" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Base class for all estimators in scikit-learn"]; "ClassifierMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Mixin class for all classifiers in scikit-learn."]; "HNSW" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)"]; "ApproximateNearestNeighbor" -> "HNSW" [arrowsize=0.5,style="setlinewidth(0.5)"]; "KNeighborsClassifier" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Classifier implementing the k-nearest neighbors vote."]; "NeighborsBase" -> "KNeighborsClassifier" [arrowsize=0.5,style="setlinewidth(0.5)"]; "KNeighborsMixin" -> "KNeighborsClassifier" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SupervisedIntegerMixin" -> "KNeighborsClassifier" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ClassifierMixin" -> "KNeighborsClassifier" [arrowsize=0.5,style="setlinewidth(0.5)"]; "KNeighborsMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Mixin for k-neighbors searches."]; "KNeighborsMixin" -> "KNeighborsMixin" [arrowsize=0.5,style="setlinewidth(0.5)"]; "KNeighborsMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Mixin for k-neighbors searches"]; "KNeighborsRegressor" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Regression based on k-nearest neighbors."]; "NeighborsBase" -> "KNeighborsRegressor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "KNeighborsMixin" -> "KNeighborsRegressor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SupervisedFloatMixin" -> "KNeighborsRegressor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RegressorMixin" -> "KNeighborsRegressor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LSH" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)"]; "ApproximateNearestNeighbor" -> "LSH" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LocalOutlierFactor" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Unsupervised Outlier Detection using Local Outlier Factor (LOF)"]; "NeighborsBase" -> "LocalOutlierFactor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "KNeighborsMixin" -> "LocalOutlierFactor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "UnsupervisedMixin" -> "LocalOutlierFactor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "OutlierMixin" -> "LocalOutlierFactor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MultiOutputMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Mixin to mark estimators that support multioutput."]; "NearestNeighbors" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Unsupervised learner for implementing neighbor searches."]; "NeighborsBase" -> "NearestNeighbors" [arrowsize=0.5,style="setlinewidth(0.5)"]; "KNeighborsMixin" -> "NearestNeighbors" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RadiusNeighborsMixin" -> "NearestNeighbors" [arrowsize=0.5,style="setlinewidth(0.5)"]; "UnsupervisedMixin" -> "NearestNeighbors" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NeighborsBase" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Base class for nearest neighbors estimators."]; "NeighborsBase" -> "NeighborsBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NeighborsBase" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Base class for nearest neighbors estimators."]; "BaseEstimator" -> "NeighborsBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MultiOutputMixin" -> "NeighborsBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "OutlierMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Mixin class for all outlier detection estimators in scikit-learn."]; "RadiusNeighborsClassifier" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Classifier implementing a vote among neighbors within a given radius"]; "NeighborsBase" -> "RadiusNeighborsClassifier" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RadiusNeighborsMixin" -> "RadiusNeighborsClassifier" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SupervisedIntegerMixin" -> "RadiusNeighborsClassifier" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ClassifierMixin" -> "RadiusNeighborsClassifier" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RadiusNeighborsMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Mixin for radius-based neighbors searches"]; "RadiusNeighborsMixin" -> "RadiusNeighborsMixin" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RadiusNeighborsMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Mixin for radius-based neighbors searches"]; "RadiusNeighborsRegressor" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Regression based on neighbors within a fixed radius."]; "NeighborsBase" -> "RadiusNeighborsRegressor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RadiusNeighborsMixin" -> "RadiusNeighborsRegressor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SupervisedFloatMixin" -> "RadiusNeighborsRegressor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RegressorMixin" -> "RadiusNeighborsRegressor" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RegressorMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="Mixin class for all regression estimators in scikit-learn."]; "SupervisedFloatMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)"]; "SupervisedIntegerMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)"]; "UnsupervisedMixin" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)"]; }