Re: [Scikit-learn-general] Cross validation with a pre-computed kernel

2015-01-06 Thread Andy
On 01/06/2015 01:21 PM, Morgan Hoffman wrote: Hi Andy, Thanks for your help. Is there something in the scikit-learn documentation (or any other resource) that explains why the kernel matrix at test time needs to be the kernel between the test data and the training data? I am quite new to mach

Re: [Scikit-learn-general] Cross validation with a pre-computed kernel

2015-01-06 Thread Morgan Hoffman
0.7 is really a 0. Thanks! Date: Tue, 6 Jan 2015 12:45:06 -0500 From: t3k...@gmail.com To: scikit-learn-general@lists.sourceforge.net Subject: Re: [Scikit-learn-general] Cross validation with a pre-computed kernel The kernel matrix at test time needs to be the kernel

Re: [Scikit-learn-general] Cross validation with a pre-computed kernel

2015-01-06 Thread Andy
I am a bit confused as to why you code doesn't crash on the call to the scaler. What is the shape of train_gram_matrix and test_gram_matrix? On 01/06/2015 12:27 PM, Morgan Hoffman wrote: Hi, I am trying to do a k-fold cross validation with a precomputed kernel. However, I end up with an erro

Re: [Scikit-learn-general] Cross validation with a pre-computed kernel

2015-01-06 Thread Andy
The kernel matrix at test time needs to be the kernel between the test data and the training data. Which I guess is not what get_gram_matrix does. Why are you applying the MinMaxScaler to the gram matrix? I'm not sure that makes sense... Without the scaler you could just do print(cross_val_sc

[Scikit-learn-general] Cross validation with a pre-computed kernel

2015-01-06 Thread Morgan Hoffman
Hi, I am trying to do a k-fold cross validation with a precomputed kernel. However, I end up with an error message that looks like this: Traceback (most recent call last): File "kfold_simple_data.py", line 64, in score = clf.score(test_gram_matrix, test_labels) File "/usr/local/lib/python2