metric-learn icon indicating copy to clipboard operation
metric-learn copied to clipboard

Including new algorithm

Open eduardomax opened this issue 7 years ago • 4 comments

Hi, i wanna know how to include one file generate from Build? Because i'm interested in include other metric learning algorithm. I'm suffering to include in the project

eduardomax avatar Apr 13 '17 22:04 eduardomax

I'm not exactly sure what you're asking, but if you'd like to open a Pull Request with your changes I'll be happy to take a look.

perimosocordiae avatar Apr 15 '17 16:04 perimosocordiae

Example, i wanna put the k-stochastic-neighbor (kNCA) from https://github.com/kswersky/k-stochastic-neighbor, but they included one lib file generated from code c++, called "knca_alg.A.dylib". So i dont know how to add :) if you can help me in this case.

eduardomax avatar Apr 20 '17 00:04 eduardomax

The first issue is that the k-stochastic-neighbor repo doesn't have a clear license, so you'll probably want to ask @kswersky for permission before copying that code here. (For reference, this repo is MIT-licensed.)

The second issue is the technical problem of including compiled code. So far, none of the methods here require compilation, so there isn't a build mechanism in place yet, but the idea is to commit the C/C++/Cython sources and configure setup.py to build the native code and place the resulting shared library in the correct location. I don't want to make native compilation a hard dependency, though, so there should be a pure-Python fallback implementation as well (like we have for LMNN).

perimosocordiae avatar Apr 26 '17 03:04 perimosocordiae

For an example of conditionally building native code, see: https://github.com/perimosocordiae/sparray/blob/e13fb0948b0f3b38813f072031d97dcf2dcd57e3/setup.py#L4

perimosocordiae avatar Apr 26 '17 03:04 perimosocordiae