<h4 dir="auto">Description</h4>
<p dir="auto">I have problems in cloning a kernel after the parameters of the kernel are set using <code class="notranslate">set_params</code><br>
I assume that this is way the kernel code has been written (logic other than the initialization in the constructor)</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sklearn.base import clone
from sklearn.gaussian_process.kernels import RBF

rbf = RBF(length_scale=[2.0, 3.0])
params = rbf.get_params()
print(params)
# {'length_scale_bounds': (1e-05, 100000.0), 'length_scale': array([ 2.,  3.])}
clone(rbf)  # Does not break

rbf_also = RBF(length_scale=[2.0])
print(rbf_also.get_params())
{'length_scale': 2.0, 'length_scale_bounds': (1e-05, 100000.0)}
clone(rbf_also)  # Does not break

rbf = RBF(length_scale=[2.0, 3.0])
params['length_scale'] = [2.0]
rbf.set_params(**params)
clone(rbf) "><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">base</span> <span class="pl-k">import</span> <span class="pl-s1">clone</span>
<span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">gaussian_process</span>.<span class="pl-s1">kernels</span> <span class="pl-k">import</span> <span class="pl-v">RBF</span>

<span class="pl-s1">rbf</span> <span class="pl-c1">=</span> <span class="pl-v">RBF</span>(<span class="pl-s1">length_scale</span><span class="pl-c1">=</span>[<span class="pl-c1">2.0</span>, <span class="pl-c1">3.0</span>])
<span class="pl-s1">params</span> <span class="pl-c1">=</span> <span class="pl-s1">rbf</span>.<span class="pl-en">get_params</span>()
<span class="pl-en">print</span>(<span class="pl-s1">params</span>)
<span class="pl-c"># {'length_scale_bounds': (1e-05, 100000.0), 'length_scale': array([ 2.,  3.])}</span>
<span class="pl-en">clone</span>(<span class="pl-s1">rbf</span>)  <span class="pl-c"># Does not break</span>

<span class="pl-s1">rbf_also</span> <span class="pl-c1">=</span> <span class="pl-v">RBF</span>(<span class="pl-s1">length_scale</span><span class="pl-c1">=</span>[<span class="pl-c1">2.0</span>])
<span class="pl-en">print</span>(<span class="pl-s1">rbf_also</span>.<span class="pl-en">get_params</span>())
{<span class="pl-s">'length_scale'</span>: <span class="pl-c1">2.0</span>, <span class="pl-s">'length_scale_bounds'</span>: (<span class="pl-c1">1e-05</span>, <span class="pl-c1">100000.0</span>)}
<span class="pl-en">clone</span>(<span class="pl-s1">rbf_also</span>)  <span class="pl-c"># Does not break</span>

<span class="pl-s1">rbf</span> <span class="pl-c1">=</span> <span class="pl-v">RBF</span>(<span class="pl-s1">length_scale</span><span class="pl-c1">=</span>[<span class="pl-c1">2.0</span>, <span class="pl-c1">3.0</span>])
<span class="pl-s1">params</span>[<span class="pl-s">'length_scale'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">2.0</span>]
<span class="pl-s1">rbf</span>.<span class="pl-en">set_params</span>(<span class="pl-c1">**</span><span class="pl-s1">params</span>)
<span class="pl-en">clone</span>(<span class="pl-s1">rbf</span>) </pre></div>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">I would expect it to clone without breaking.</p>
<p dir="auto">Clusters can be found within a training dataset (transductive) then used to train a classifier, so as to extend the clustering model to new instances. See snippet at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="67017319" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/4543" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/4543/hovercard?comment_id=91073246&amp;comment_type=issue_comment" href="https://github.com/scikit-learn/scikit-learn/issues/4543#issuecomment-91073246">#4543 (comment)</a></p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/selwyth/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/selwyth">@selwyth</a> is <a href="https://github.com/scikit-learn/scikit-learn/issues/4543#issuecomment-91185832" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/4543/hovercard">apparently working on this</a>.</p>