Hi Andreas,
Thanks for your response.
No, PAA does not change the number of samples. It just reduces the number
of features.
For example if the input matrix is X and X.shape = (100, 100) and the
n_components = 10 in PAA, then the resultant X.shape = (100, 10).
Yes, I did try using PAA in the ipython shell (without the grid search) on
the same dataset and it does the transformation as expected.
Another interesting observation is that the dataset that I have used in the
code has dimensions (56, 256) and also 37 + 19 = 56. Does this provide any
insight about the error?
[image: --]
Jitesh Khandelwal
<http://about.me/jitesh.khandelwal?promo=email_sig>
[image: http://]about.me/jitesh.khandelwal
<http://about.me/jitesh.khandelwal?promo=email_sig>
On Tue, Apr 28, 2015 at 12:26 AM, Andreas Mueller <t3k...@gmail.com> wrote:
> 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
> listScikit-learn-general@lists.sourceforge.nethttps://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
>
>
------------------------------------------------------------------------------
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