spopt icon indicating copy to clipboard operation
spopt copied to clipboard

The dissimilarity parameter should be able to accept a distance/dissimilarity matrix as an alternative to a callable distance function

Open Shruthi-Patil opened this issue 4 years ago • 5 comments

I'm currently working on spatial aggregation of energy systems data. Skater seems interesting for my problem and I would like to try it.

However, the issue is that my data is 3-dimensional and has a complex structure. I compute the distance between each region pair and generate a matrix containing this info.

It would be very helpful for my case and many other cases if the dissimilarity could be provided in the form of a pre-computed distance matrix, instead of a distance function.

Shruthi-Patil avatar Aug 11 '21 13:08 Shruthi-Patil

@ljwolf @knaaptime @xf37 Would any of yall be able to look into this?

jGaboardi avatar Aug 11 '21 13:08 jGaboardi

Yeah, this should be easy to do. We would need to allow for "dissimilarity='precomputed'", as is common in other sklearn-style estimators.

As it stands @Shruthi-Patil, you could try using sklearn.cluster.AgglomerativeClustering(), which currently supports both precomputed affinity and connectivity constraints?

ljwolf avatar Aug 11 '21 13:08 ljwolf

@ljwolf I’m currently using the same. The results are okayish. That’s why we’re looking for alternatives. :)

Shruthi-Patil avatar Aug 12 '21 17:08 Shruthi-Patil

Interesting.... well I can take a look at customizing this very soon. I think the diff would be about 6 lines.

ljwolf avatar Aug 12 '21 18:08 ljwolf

Thanks. I look forward to it 😀

Shruthi-Patil avatar Aug 13 '21 01:08 Shruthi-Patil

@Shruthi-Patil Do you still have any interest in seeing this move forward in #188? If not, we'll go ahead and close it out.

jGaboardi avatar Oct 22 '22 12:10 jGaboardi

@jGaboardi Thanks for the tweaks. However, we went with another algorithm. So please go ahead and close it.

Shruthi-Patil avatar Oct 24 '22 06:10 Shruthi-Patil