On 2011-11-09, at 3:01 PM, Mathieu Blondel wrote:

> On Thu, Nov 10, 2011 at 2:31 AM, Olivier Grisel
> <[email protected]> wrote:
> 
>> Maybe it would be better to have a dedicated method for this use case
>> rather that using complex kwargs in the `fit` method. What about using
>> a `fit_from_kernel` or `fit_from_affinity` method (if you find a
>> better name)?
> 
> For me the main problem of precomputed kernels is more the data
> representation than the method names.
> 
> 1) storing a symmetric matrix in a 2d dense array is inefficient memory-wise

Yes, but often it is still the most straightforward, so absolutely requiring a 
packed triangle may be an annoyance. Also, many LAPACK routines still expect a 
square matrix even if they only look at the (upper, lower) triangle ({ds}posv 
for solving symmetric positive systems with the Cholesky factorization comes to 
mind).

> User-defined kernel functions could be an answer to all 1), 2) and 3)
> if the function was called on-demand but I think the current
> implementation just pre-computes the entire Gram matrix.

Indeed... I wonder: if, from Python, you pass a reference to a cpdef'd function 
to another cpdef'd function as an argument, is Cython smart enough to run the 
passed function at C speed? Or can it only do that at compile time?

David
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to