-1

I am trying to add a custom linkage function to the hierarchical clustering in SciPy. I can't seem to access the implementation which redirects to _hierarchy.linkage(y, n, method_code) in .so compiled file.

Any idea on how to go further in a clean way?

Thanks

1 Answers1

0

Get the sklearn source code.

Modify it, then compile the Cython code to get a new .so file.

Using pure Python code would be too slow, it is necessary to compile this into C. Cython is very similar to Python, but with static typing and compiled to native code.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194