Check sklearn version before loading model using joblib
<p>I've followed <a href="http://scikit-learn.org/stable/modules/model_persistence.html" rel="nofollow noreferrer" title="this guide">this guide</a> to save a machine learning model for later use. The model was dumped in one machine:</p>
<pre><code>from sklearn.externals import joblib
joblib.dump(clf, 'model.pkl')
</code></pre>
<p>And when I loaded it <code>joblib.load('model.pkl')</code> in another machine, I got this warning:</p>
<blockquote>
<p>UserWarning: Trying to unpickle estimator DecisionTreeClassifier from
version pre-0.18 when using version 0.18.1. This might lead to
breaking code or invalid results. Use at your own risk.</p>
</blockquote>
<p>So is there any way to know the sklearn version of the saved model to compare it with the current version?</p>