Here's a small example I coded up that shows how I envision including multiple distance metrics in BallTree
https://gist.github.com/1565998 The idea is that you create functions to compute distance which expose C function pointers, so that the ball tree cython code can call these without python overhead. I'd be curious to hear peoples' thoughts Jake Gael Varoquaux wrote: > On Wed, Jan 04, 2012 at 07:59:04AM -0800, Jacob VanderPlas wrote: > >> If someone has a good idea about how one could specify these distance >> metrics from python code, with optional ancillary parameters, and >> convert these specifications into code for fast distance computation >> within cython, >> > > How about using small Cython classes with one or two methods? This is > what ended up working well for the decision trees (see _tree.pyx). > > Gael > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Scikit-learn-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general > ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
