cinnamon
cinnamon

Reputation: 1

How to add another parameter to sklearn DBSCAN

I have a list of points I wish to make as core points for DBSCAN. I am aware that I can subclass sklearn DBSCAN to explicitly set my core points similar to the first comment here: How to provide core points in DBSCAN?

Now, I wish to add something like core_point parameter in def fit or def fit_predict but I am lost as to how to do exactly that.

The origial code is : # A list of all core samples found. core_samples = np.asarray(n_neighbors >= self.min_samples, dtype=np.uint8) dbscan_inner(core_samples, neighborhoods, labels)

and I updated it likeso:

core_samples = [] for samples in core_data: core_samples.append(samples['x']) core_samples = np.asarray(n_neighbors >= self.min_samples, dtype=np.uint8) dbscan_inner(core_samples, neighborhoods, labels)

I wish to add the core_data as a parameter for def fit or def fit_predict and call it in my inference code.

Upvotes: 0

Views: 30

Answers (0)

Related Questions