vastorbit.machine_learning.vast.cluster.DBSCAN.predict¶
- DBSCAN.predict() VastFrame¶
Creates a
VastFrameof the model.- Returns:
the
VastFrameincluding the prediction.- Return type:
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()
123colDecimal(12, 2)123dbscan_clustersInteger1 102.0 -1 2 2.2 1 3 0.9 0 4 1.3 0 5 1.2 0 6 2.0 1 7 1.09 0 8 100.0 -1 9 1.5 0 10 1.1 0 Rows: 1-10 | Columns: 2Note
Refer to
DBSCANfor more information about the different methods and usages.