title: How can anisotropic kernels for Gaussian process regression be used with a variable number of features?
body: <p>My use case is, that I want to have automatic feature selection for Gaussian process regression. For isotropic kernels, this can be done easily, as shown in the following example:</p>
  
  <pre><code>import numpy as np
  from mlxtend.feature_selection import SequentialFeatureSelector
  from sklearn.gaussian_process import GaussianProcessRegressor
  from sklearn.gaussian_process.kernels import RBF
  
  X = np.random.rand(100, 10)
  y = np.random.rand(100)
  
  gpr = GaussianProcessRegressor(kernel=RBF(length_scale=[1]))
  selector = SequentialFeatureSelector(gpr, forward=False)
  selector.fit(X, y)
  </code></pre>
  
  <p>In order to use anisotropic kernels, one would have to change the definition of the kernel to <code>RBF(length_scale=[1] * num_features)</code>.</p>
  
  <p>However, the number of features changes in each round of the feature selection, which raises <code>ValueError: Anisotropic kernel must have the same number of dimensions as data (10!=9)</code></p>
  
  <p>Is there any way to get an anisotropic kernel with a dynamic number of features?</p>