I'm new to DBSCAN. I was looking at a few examples online and came across a few instances where the following lines were used while importing the dbscan module:

from sklearn.cluster.dbscan_ import DBSCAN
from sklearn.cluster.dbscan_ import dbscan

I would like to know if there is anything different between them? Or is it necessary for me to import both DBSCAN and dbscan?

Here's one link where both lines are used in the import: https://gemfury.com/stream/python:scikit-learn/-/content/cluster/tests/test_dbscan.py


1 Answer 1


Such questions are easily answered if you check the source code yourself.


One is an object-oriented wrapper with a more common API, the other the underlying function that does the actual work. Since the wrapper just calls the function, the results are not substantially different, only the presentation.

Hence, usually you won't need both.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.