Does PAA by any chance change the number of samples?
The error is:
ValueError: Found array with dim 37. Expected 19

Interestingly that happens only in the scoring.

Does it work without the grid-search?


On 04/27/2015 07:14 AM, Jitesh Khandelwal wrote:
Hi all,

I am trying to use grid search to evaluate some decomposition techniques of my own. I have implemented some custom transformers such as PAA, DFT, DWT as shown in the code below.

I am getting a strange "ValueError" when run the below code and I am unable to figure out the origin of the problem.

I have pasted the code below and attached the error log file.

Any suggestions on how can I move forward from here would be helpful.

Thanks.

Code:
=======================================================
from sklearn.pipeline import Pipeline
from sklearn.grid_search import GridSearchCV
from sklearn.neighbors import KNeighborsClassifier

from time_series.decomposition import PAA, DFT, DWT, ShapeX
from prepare_data import combine_train_test_dataset

knn = KNeighborsClassifier()
paa = PAA()

pipe = Pipeline([
    ('paa', paa),
    ('knn', knn)
])

n_components = [1,2,4,5,10,20,40]
n_neighbors = range(1,11)
metrics = ['euclidean']

datadir = "../keogh_datasets/Coffee"
X,y = combine_train_test_dataset(datadir)

model_tunning = GridSearchCV(pipe, {
        'paa__n_components': n_components,
        'knn__n_neighbors': n_neighbors,
        'knn__metric': metrics,
    },
    n_jobs=-1)

model_tunning.fit(X,y)

print model_tunning.best_score_
print model_tunning.best_params_
=======================================================



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y


_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to