Loading...

vastorbit.machine_learning.vast.cluster.DBSCAN.plot

DBSCAN.plot(max_nb_points: int = 100, chart: PlottingBase | TableSample | Axes | mFigure | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | 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:

Plotting Object.

Return type:

obj

Examples

Let’s start by importing vastorbit:

import vastorbit as vo

For this example, we will create a small dataset.

data = vo.VastFrame(
    {
        "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 vastorbit.machine_learning.vast 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.