.. note::
    :class: sphx-glr-download-link-note

    Click :ref:`here <sphx_glr_download_auto_examples_compose_plot_compare_reduction.py>` to download the full example code
.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_compose_plot_compare_reduction.py:


=================================================================
Selecting dimensionality reduction with Pipeline and GridSearchCV
=================================================================

This example constructs a pipeline that does dimensionality
reduction followed by prediction with a support vector
classifier. It demonstrates the use of ``GridSearchCV`` and
``Pipeline`` to optimize over different classes of estimators in a
single CV run -- unsupervised ``PCA`` and ``NMF`` dimensionality
reductions are compared to univariate feature selection during
the grid search.

Additionally, ``Pipeline`` can be instantiated with the ``memory``
argument to memoize the transformers within the pipeline, avoiding to fit
again the same transformers over and over.

Note that the use of ``memory`` to enable caching becomes interesting when the
fitting of a transformer is costly.


Illustration of ``Pipeline`` and ``GridSearchCV``
##############################################################################
 This section illustrates the use of a ``Pipeline`` with
 ``GridSearchCV``



.. code-block:: python


    # Authors: Robert McGibbon, Joel Nothman, Guillaume Lemaitre

    from __future__ import print_function, division

    import numpy as np
    import matplotlib.pyplot as plt
    from sklearn.datasets import load_digits
    from sklearn.model_selection import GridSearchCV
    from sklearn.pipeline import Pipeline
    from sklearn.svm import LinearSVC
    from sklearn.decomposition import PCA, NMF
    from sklearn.feature_selection import SelectKBest, chi2

    print(__doc__)

    pipe = Pipeline([
        ('reduce_dim', PCA()),
        ('classify', LinearSVC())
    ])

    N_FEATURES_OPTIONS = [2, 4, 8]
    C_OPTIONS = [1, 10, 100, 1000]
    param_grid = [
        {
            'reduce_dim': [PCA(iterated_power=7), NMF()],
            'reduce_dim__n_components': N_FEATURES_OPTIONS,
            'classify__C': C_OPTIONS
        },
        {
            'reduce_dim': [SelectKBest(chi2)],
            'reduce_dim__k': N_FEATURES_OPTIONS,
            'classify__C': C_OPTIONS
        },
    ]
    reducer_labels = ['PCA', 'NMF', 'KBest(chi2)']

    grid = GridSearchCV(pipe, cv=5, n_jobs=1, param_grid=param_grid)
    digits = load_digits()
    grid.fit(digits.data, digits.target)

    mean_scores = np.array(grid.cv_results_['mean_test_score'])
    # scores are in the order of param_grid iteration, which is alphabetical
    mean_scores = mean_scores.reshape(len(C_OPTIONS), -1, len(N_FEATURES_OPTIONS))
    # select score for best C
    mean_scores = mean_scores.max(axis=0)
    bar_offsets = (np.arange(len(N_FEATURES_OPTIONS)) *
                   (len(reducer_labels) + 1) + .5)

    plt.figure()
    COLORS = 'bgrcmyk'
    for i, (label, reducer_scores) in enumerate(zip(reducer_labels, mean_scores)):
        plt.bar(bar_offsets + i, reducer_scores, label=label, color=COLORS[i])

    plt.title("Comparing feature reduction techniques")
    plt.xlabel('Reduced number of features')
    plt.xticks(bar_offsets + len(reducer_labels) / 2, N_FEATURES_OPTIONS)
    plt.ylabel('Digit classification accuracy')
    plt.ylim((0, 1))
    plt.legend(loc='upper left')

    plt.show()




.. image:: /auto_examples/compose/images/sphx_glr_plot_compare_reduction_001.png
    :class: sphx-glr-single-img




Caching transformers within a ``Pipeline``
##############################################################################
 It is sometimes worthwhile storing the state of a specific transformer
 since it could be used again. Using a pipeline in ``GridSearchCV`` triggers
 such situations. Therefore, we use the argument ``memory`` to enable caching.

 .. warning::
     Note that this example is, however, only an illustration since for this
     specific case fitting PCA is not necessarily slower than loading the
     cache. Hence, use the ``memory`` constructor parameter when the fitting
     of a transformer is costly.



.. code-block:: python


    from tempfile import mkdtemp
    from shutil import rmtree
    from sklearn.utils import Memory

    # Create a temporary folder to store the transformers of the pipeline
    cachedir = mkdtemp()
    memory = Memory(cachedir=cachedir, verbose=10)
    cached_pipe = Pipeline([('reduce_dim', PCA()),
                            ('classify', LinearSVC())],
                           memory=memory)

    # This time, a cached pipeline will be used within the grid search
    grid = GridSearchCV(cached_pipe, cv=5, n_jobs=1, param_grid=param_grid)
    digits = load_digits()
    grid.fit(digits.data, digits.target)

    # Delete the temporary cache before exiting
    rmtree(cachedir)





.. rst-class:: sphx-glr-script-out

 Out:

 .. code-block:: none

    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=2, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=2, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=2, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=2, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=2, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=4, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=4, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=4, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=4, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=4, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=8, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=8, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=8, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=8, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=8, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=2, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=2, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=2, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=2, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=2, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=4, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=4, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=4, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=4, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=4, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=8, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=8, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=8, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=8, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(NMF(alpha=0.0, beta_loss='frobenius', init=None, l1_ratio=0.0, max_iter=200,
      n_components=8, random_state=None, shuffle=False, solver='cd',
      tol=0.0001, verbose=0), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.1s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/1bf27be7972a60c9d2d8c9a16106dec2
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/118acd4d367dec57f2179a23f47c5cc1
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/16f8f016b2ae2c2c937ec68432160272
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/9847e1eeffb9fd5847cdaa065c13124b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eb0de9c35b4820de6156126095b61515
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/81129a44af6685b5116436d813d312e6
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eae05ab59792a48c4b673ef14f04c334
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/a138284acd57796087a9815d19f14450
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/0d155537afbf97708c84bb7fb6b72f5d
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/3971c76218de052c4541ed6d4b3a9218
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/0b059d708761697b71ff9674f8ef00ce
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/56c396594208af87a823c9eadb4c0ccc
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/581707498b7d140bddb13175b9c2affc
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/2b336e46229519ac952da37ad064a2b7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/15e7389e6d490d9ce6ca3705a7ebe4c7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/f3ca0fc33d1e63f118025e2d56dae092
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/4a2dd15d22fee391e2703b4ff04d5743
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/ad0b8560e8dd1d91f5bc69d99cd67e42
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/c6b159d456d65af304fcb65345ab7604
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/d717af99125b3679d71c7146b31ba335
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/fc84a32a9a12e045acabbeb1bdf26a2a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eed3ef7a1a4d6f36c783aef53fd880d7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/a152ea3c11e7851d30e067e014fcc22b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/472fff6d26a6c09950e3cabfee0787c3
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/92a667fb8aa40ba56ffc775cbe10d662
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/330e79733970b91b7f78b0c5a102d9e3
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/fc9a67e41c53fb1caf96a1dad2704a03
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/45726c7f83ba9f84fec47868d4e9b512
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b6f38864a22aaf65eda4c39410ec6d7f
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/641c70e402c0cef91f6939b2262ddc3b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/1bf27be7972a60c9d2d8c9a16106dec2
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/118acd4d367dec57f2179a23f47c5cc1
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/16f8f016b2ae2c2c937ec68432160272
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/9847e1eeffb9fd5847cdaa065c13124b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eb0de9c35b4820de6156126095b61515
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/81129a44af6685b5116436d813d312e6
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eae05ab59792a48c4b673ef14f04c334
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/a138284acd57796087a9815d19f14450
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/0d155537afbf97708c84bb7fb6b72f5d
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/3971c76218de052c4541ed6d4b3a9218
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/0b059d708761697b71ff9674f8ef00ce
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/56c396594208af87a823c9eadb4c0ccc
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/581707498b7d140bddb13175b9c2affc
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/2b336e46229519ac952da37ad064a2b7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/15e7389e6d490d9ce6ca3705a7ebe4c7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/f3ca0fc33d1e63f118025e2d56dae092
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/4a2dd15d22fee391e2703b4ff04d5743
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/ad0b8560e8dd1d91f5bc69d99cd67e42
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/c6b159d456d65af304fcb65345ab7604
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/d717af99125b3679d71c7146b31ba335
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/fc84a32a9a12e045acabbeb1bdf26a2a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eed3ef7a1a4d6f36c783aef53fd880d7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/a152ea3c11e7851d30e067e014fcc22b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/472fff6d26a6c09950e3cabfee0787c3
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/92a667fb8aa40ba56ffc775cbe10d662
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/330e79733970b91b7f78b0c5a102d9e3
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/fc9a67e41c53fb1caf96a1dad2704a03
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/45726c7f83ba9f84fec47868d4e9b512
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b6f38864a22aaf65eda4c39410ec6d7f
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/641c70e402c0cef91f6939b2262ddc3b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/1bf27be7972a60c9d2d8c9a16106dec2
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/118acd4d367dec57f2179a23f47c5cc1
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/16f8f016b2ae2c2c937ec68432160272
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/9847e1eeffb9fd5847cdaa065c13124b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eb0de9c35b4820de6156126095b61515
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/81129a44af6685b5116436d813d312e6
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eae05ab59792a48c4b673ef14f04c334
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/a138284acd57796087a9815d19f14450
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/0d155537afbf97708c84bb7fb6b72f5d
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/3971c76218de052c4541ed6d4b3a9218
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/0b059d708761697b71ff9674f8ef00ce
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/56c396594208af87a823c9eadb4c0ccc
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/581707498b7d140bddb13175b9c2affc
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/2b336e46229519ac952da37ad064a2b7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/15e7389e6d490d9ce6ca3705a7ebe4c7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/f3ca0fc33d1e63f118025e2d56dae092
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/4a2dd15d22fee391e2703b4ff04d5743
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/ad0b8560e8dd1d91f5bc69d99cd67e42
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/c6b159d456d65af304fcb65345ab7604
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/d717af99125b3679d71c7146b31ba335
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/fc84a32a9a12e045acabbeb1bdf26a2a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/eed3ef7a1a4d6f36c783aef53fd880d7
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/a152ea3c11e7851d30e067e014fcc22b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/472fff6d26a6c09950e3cabfee0787c3
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/92a667fb8aa40ba56ffc775cbe10d662
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/330e79733970b91b7f78b0c5a102d9e3
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/fc9a67e41c53fb1caf96a1dad2704a03
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/45726c7f83ba9f84fec47868d4e9b512
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b6f38864a22aaf65eda4c39410ec6d7f
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/641c70e402c0cef91f6939b2262ddc3b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=2, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=2, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=2, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=2, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=2, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=4, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=4, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=4, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=4, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=4, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=8, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=8, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=8, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=8, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(SelectKBest(k=8, score_func=<function chi2 at 0x7f5abe3ea378>), array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 9]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/de5a7bedfde15e0c1845070a250917eb
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/d53cf5eb7f0d0aa0e4c99b2e25e25e64
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/7c9022da75316582f8db2a2c2b090579
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/f5d392ce8612bd0c49f7e4e3acecff2a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/af89db3a2b0a317ce379b1228e447f8a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/cc7ba86a0b65f1843a02f39b61062b41
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/438416c4e1c8599d97235629df2312f1
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/49f24ea1af20ab3b1816189cc3d70d8b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b90601f379b29e5f581d7a6d9f3ca362
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/abb162c893616172784c21d426db3a34
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b08c4874cfa9f5290666997ea90e97bd
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/518abddb55ea46ac66ee0b21be519d29
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/80b2fab7c238d00a796c7693e39ff237
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/772e0544b25dc54bdd425b0216d19de9
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/46d4254639ea1006d4444c6a3922783b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/de5a7bedfde15e0c1845070a250917eb
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/d53cf5eb7f0d0aa0e4c99b2e25e25e64
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/7c9022da75316582f8db2a2c2b090579
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/f5d392ce8612bd0c49f7e4e3acecff2a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/af89db3a2b0a317ce379b1228e447f8a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/cc7ba86a0b65f1843a02f39b61062b41
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/438416c4e1c8599d97235629df2312f1
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/49f24ea1af20ab3b1816189cc3d70d8b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b90601f379b29e5f581d7a6d9f3ca362
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/abb162c893616172784c21d426db3a34
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b08c4874cfa9f5290666997ea90e97bd
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/518abddb55ea46ac66ee0b21be519d29
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/80b2fab7c238d00a796c7693e39ff237
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/772e0544b25dc54bdd425b0216d19de9
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/46d4254639ea1006d4444c6a3922783b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/de5a7bedfde15e0c1845070a250917eb
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/d53cf5eb7f0d0aa0e4c99b2e25e25e64
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/7c9022da75316582f8db2a2c2b090579
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/f5d392ce8612bd0c49f7e4e3acecff2a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/af89db3a2b0a317ce379b1228e447f8a
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/cc7ba86a0b65f1843a02f39b61062b41
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/438416c4e1c8599d97235629df2312f1
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/49f24ea1af20ab3b1816189cc3d70d8b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b90601f379b29e5f581d7a6d9f3ca362
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/abb162c893616172784c21d426db3a34
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/b08c4874cfa9f5290666997ea90e97bd
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/518abddb55ea46ac66ee0b21be519d29
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/80b2fab7c238d00a796c7693e39ff237
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/772e0544b25dc54bdd425b0216d19de9
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    [Memory]0.0s, 0.0min    : Loading _fit_transform_one from /tmp/tmp8hfsmb5m/joblib/sklearn/pipeline/_fit_transform_one/46d4254639ea1006d4444c6a3922783b
    ___________________________________fit_transform_one cache loaded - 0.0s, 0.0min
    ________________________________________________________________________________
    [Memory] Calling sklearn.pipeline._fit_transform_one...
    _fit_transform_one(PCA(copy=True, iterated_power=7, n_components=8, random_state=None,
      svd_solver='auto', tol=0.0, whiten=False), 
    array([[0., ..., 0.],
           ...,
           [0., ..., 0.]]), array([0, ..., 8]), None)
    ________________________________________________fit_transform_one - 0.0s, 0.0min


The ``PCA`` fitting is only computed at the evaluation of the first
configuration of the ``C`` parameter of the ``LinearSVC`` classifier. The
other configurations of ``C`` will trigger the loading of the cached ``PCA``
estimator data, leading to save processing time. Therefore, the use of
caching the pipeline using ``memory`` is highly beneficial when fitting
a transformer is costly.


**Total running time of the script:** ( 1 minutes  54.327 seconds)


.. _sphx_glr_download_auto_examples_compose_plot_compare_reduction.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example



  .. container:: sphx-glr-download

     :download:`Download Python source code: plot_compare_reduction.py <plot_compare_reduction.py>`



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: plot_compare_reduction.ipynb <plot_compare_reduction.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
