# DBSCAN

### *class* cuml.dask.cluster.DBSCAN(, client=None, verbose=False, \*\*kwargs)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/dask/cluster/dbscan.py#L18)

Multi-Node Multi-GPU implementation of DBSCAN.

The whole dataset is copied to all the workers but the work is then
divided by giving “ownership” of a subset to each worker: each worker
computes a clustering by considering the relationships between those
points and the rest of the dataset, and partial results are merged at
the end to obtain the final clustering.

* **Parameters:**
  **client**
  : Dask client to use

  **verbose**
  : Sets logging level. It must be one of `cuml.common.logger.level_*`.
    See [Verbosity Levels](../../cuml/index.html.md#verbosity-levels) for more info.

  **min_samples**
  : The number of samples in a neighborhood such that this group can be
    considered as an important core point (including the point itself).

  **max_mbytes_per_batch**
  : Calculate batch size using no more than this number of megabytes for
    the pairwise distance computation. This enables the trade-off between
    runtime and memory usage for making the N^2 pairwise distance
    computations more tractable for large numbers of samples.
    If you are experiencing out of memory errors when running DBSCAN, you
    can set this value based on the memory size of your device.
    Note: this option does not set the maximum total memory used in the
    DBSCAN computation and so this value will not be able to be set to
    the total memory available on the device.

  **output_type**
  : Return results and set estimator attributes to the indicated output
    type. If None, the output type set at the module level
    (`cuml.global_settings.output_type`) will be used. See
    [Output Data Type Configuration](../../cuml/index.html.md#output-data-type-configuration) for more info.

  **calc_core_sample_indices**
  : Indicates whether the indices of the core samples should be calculated.
    The the attribute `core_sample_indices_` will not be used, setting this
    to False will avoid unnecessary kernel launches

### Methods

| [`fit`](#cuml.dask.cluster.DBSCAN.fit)(X[, out_dtype])         | Fit a multi-node multi-GPU DBSCAN model              |
|------------------------------------------------------------------------------|------------------------------------------------------|
| [`fit_predict`](#cuml.dask.cluster.DBSCAN.fit_predict)(X[, out_dtype]) | Performs clustering on X and returns cluster labels. |

### Notes

For additional docs, see the documentation of the single-GPU DBSCAN model

<!-- !! processed by numpydoc !! -->

#### fit(X, out_dtype='int32')[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/dask/cluster/dbscan.py#L80)

Fit a multi-node multi-GPU DBSCAN model

* **Parameters:**
  **X**
  : Dense matrix containing floats or doubles.
    Acceptable formats: CUDA array interface compliant objects like
    CuPy, cuDF DataFrame/Series, NumPy ndarray and Pandas
    DataFrame/Series.

  **out_dtype: dtype Determines the precision of the output labels array.**
  : default: “int32”. Valid values are { “int32”, np.int32,
    “int64”, np.int64}.

<!-- !! processed by numpydoc !! -->

#### fit_predict(X, out_dtype='int32')[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/dask/cluster/dbscan.py#L141)

Performs clustering on X and returns cluster labels.

* **Parameters:**
  **X**
  : Dense matrix containing floats or doubles.
    Acceptable formats: CUDA array interface compliant objects like
    CuPy, cuDF DataFrame/Series, NumPy ndarray and Pandas
    DataFrame/Series.

  **out_dtype: dtype Determines the precision of the output labels array.**
  : default: “int32”. Valid values are { “int32”, np.int32,
    “int64”, np.int64}.

  **Returns**

  **——-**

  **labels: array-like (device or host)**
  : Integer array of labels

<!-- !! processed by numpydoc !! -->

#### get_combined_model()[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/dask/common/base.py#L57)

Return single-GPU model for serialization

* **Returns:**
  **model**
  : yet been trained.

<!-- !! processed by numpydoc !! -->
