<h4 dir="auto">Description</h4>
<p dir="auto">I have the same error as indicated on stack overflow (<a href="https://stackoverflow.com/questions/43964166/imp-module-is-deprecated-in-favour-of-importlib" rel="nofollow">https://stackoverflow.com/questions/43964166/imp-module-is-deprecated-in-favour-of-importlib</a>)<br>
And, Khushhalm's answer on this page does fix the problem; but I'm wondering if this could be fixed permanently. Thanks.</p>
<p dir="auto">importing sklearn modules ..</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sklearn.base import BaseEstimator, TransformerMixin"><pre class="notranslate"><code class="notranslate">from sklearn.base import BaseEstimator, TransformerMixin
</code></pre></div>
<p dir="auto">generates this error</p>
<p dir="auto">/usr/local/lib/python3.6/dist-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<p dir="auto">starting the Python terminal and entering the following</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sklearn.base import BaseEstimator, TransformerMixin"><pre class="notranslate"><code class="notranslate">from sklearn.base import BaseEstimator, TransformerMixin
</code></pre></div>
<p dir="auto">generates this error</p>
<p dir="auto">/usr/local/lib/python3.6/dist-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses</p>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">No error is thrown.</p>
<h4 dir="auto">Actual Results</h4>
<p dir="auto">/usr/local/lib/python3.6/dist-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses</p>
<h4 dir="auto">Versions</h4>
<h2 dir="auto">System</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="python: 3.6.6 (default, Sep 12 2018, 18:26:19)  [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]"><pre class="notranslate"><code class="notranslate">python: 3.6.6 (default, Sep 12 2018, 18:26:19)  [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
</code></pre></div>
<p dir="auto">executable: /usr/local/bin/python<br>
machine: Linux-4.4.0-137-generic-x86_64-with-Ubuntu-18.04-bionic</p>
<h2 dir="auto">BLAS</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="macros:"><pre class="notranslate"><code class="notranslate">macros:
</code></pre></div>
<p dir="auto">lib_dirs:<br>
cblas_libs: cblas</p>
<h2 dir="auto">Python deps</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   pip: 18.1"><pre class="notranslate"><code class="notranslate">   pip: 18.1
</code></pre></div>
<p dir="auto">setuptools: 39.0.1<br>
sklearn: 0.20.0<br>
numpy: 1.15.2<br>
scipy: 1.1.0<br>
Cython: 0.29<br>
pandas: 0.23.4</p>
<p dir="auto">Imagine you had a lot of columns, but that some of those columns never changed or were duplicated due to any number of circumstances. You might not even notice that you have these useless columns. It would be nice to have an optional preprocessing function that warns you about columns that would add no new information to the training, and optionally, trim those columns. Algorithms like <code class="notranslate">build_tree</code> still have to consider those columns, and it gets expensive. Apologies if this is not the place for my comment.</p>