scholar icon indicating copy to clipboard operation
scholar copied to clipboard

Add predict function to DBSCAN clustering algorithm

Open b-serra opened this issue 1 year ago • 3 comments

Is there any reason why DBSCAN module lacks of predict function compared to other clustering models contained here.

b-serra avatar Apr 22 '24 18:04 b-serra

Hi @b-serra! I could be wrong, but I don't think DBSCAN can assign cluster labels to points other than those used for training the model. Looking at the scikit-learn implementation I see that it doesn't have predict as well.

krstopro avatar Apr 22 '24 18:04 krstopro

Hi @krstopro! There is a fit_predict method in scikit-learn. Anyway I did not notice that scholar aims to map scikit-learn lib! My bad.

EDIT: Just checked that scikit-learn fit_predict method returns the result labels. Therefore as scholar implementation already returns labels values, there is no need for a predict or fit_predict funcion.

b-serra avatar Apr 22 '24 18:04 b-serra

There is a fit_predict method in scikit-learn.

Perhaps we should add fit_predict here as well. I am not sure about it because fit_predict would just return the labels of the model fit on x.

Anyway I did not notice that scholar aims to map scikit-learn lib! My bad.

No worries - any suggestions are welcome! There is a substantial difference between how the two actually work because Scholar is built on top of Nx. In case you are not familiar with it I suggest having a look at Introduction to Nx.

krstopro avatar Apr 22 '24 19:04 krstopro