how to save a scikit-learn pipline with keras regressor inside to disk?
<p>I have a scikit-learn pipline with kerasRegressor in it:</p>

<pre><code>estimators = [
    ('standardize', StandardScaler()),
    ('mlp', KerasRegressor(build_fn=baseline_model, nb_epoch=5, batch_size=1000, verbose=1))
    ]
pipeline = Pipeline(estimators)
</code></pre>

<p>After, training the pipline, I am trying to save to disk using joblib...</p>

<pre><code>joblib.dump(pipeline, filename , compress=9)
</code></pre>

<p>But I am getting an error:</p>

<blockquote>
  <p>RuntimeError: maximum recursion depth exceeded</p>
</blockquote>

<p>How would you save the pipeline to disk?</p>