Is there anyway in sklearn to allow for higher dimensional clustering by the DBSCAN algorithm? In my case I want to cluster on 3 and 4 dimensional data. I checked some of the source code and see the DBSCAN class calls the check_array function from the sklearn utils package which includes an argument allow_nd. By default it is set to false and there doesn’t seem to be a way to set it through the DBSCAN class constructor. Any thoughts/ideas or am I missing something simple? Thanks!
EDIT: Minimal code (I am using sklearn version 0.20.2).
import numpy as np
from sklearn.cluster import DBSCAN
data = np.random.rand(128, 416, 1)
db = DBSCAN()
db.fit_predict(data)
This is a sample but it works on any real data that I load as well. Here is the exact error returned:
ValueError: Found array with dim 3. Estimator expected <= 2.
Here is the shape and ndim of the ndarray above.
(128, 416, 1)
3