Loading...

verticapy.machine_learning.vertica.cluster.DBSCAN.plot#

DBSCAN.plot(max_nb_points: int = 100, chart: PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure#

Draws the model.

Parameters#

max_nb_points: int

Maximum number of points to display.

chart: PlottingObject, optional

The chart object to plot on.

**style_kwargs

Any optional parameter to pass to the Plotting functions.

Returns#

obj

Plotting Object.

Examples#

Let’s start by importing verticapy:

import verticapy as vp

For this example, we will create a small dataset.

data = vp.vDataFrame(
    {
        "col1": [1.2, 1.1, 1.3, 1.5, 2, 2.2, 1.09, 0.9, 100, 102],
        "col2": [2.2, 2.1, 4.3, 5.5, 6, 2, 9, 1, 110, 120],
    },
)

Then we import the model:

from verticapy.machine_learning.vertica import DBSCAN

Then we can create the model:

model = DBSCAN(
    eps = 0.5,
    min_samples = 2,
    p = 2,
)

Once the model is initialized we can fit the model:

model.fit(data, X = ["col1", "col2"])

And lastly we can plot the model:

model.plot()

Note

Refer to DBSCAN for more information about the different methods and usages.