Loading...

vastorbit.machine_learning.vast.cluster.DBSCAN.predict

DBSCAN.predict() VastFrame

Creates a VastFrame of the model.

Returns:

the VastFrame including the prediction.

Return type:

VastFrame

Examples

Let’s start by importing vastorbit:

import vastorbit as vo

For this example, we will create a small dataset.

data = vo.VastFrame(
    {
        "col": [1.2, 1.1, 1.3, 1.5, 2, 2.2, 1.09, 0.9, 100, 102],
    }
)

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 = ["col"])

And lastly we can use the trained model to predict:

model.predict()
123
col
Decimal(12, 2)
123
dbscan_clusters
Integer
1102.0-1
22.21
30.90
41.30
51.20
62.01
71.090
8100.0-1
91.50
101.10
Rows: 1-10 | Columns: 2

Note

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