elixir-nx / scholar

Traditional machine learning on top of Nx
Apache License 2.0
408 stars 44 forks source link

Add predict function to DBSCAN clustering algorithm #259

Open b-serra opened 4 months ago

b-serra commented 4 months ago

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

krstopro commented 4 months ago

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.

b-serra commented 4 months ago

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.

krstopro commented 4 months ago

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.