title: Error while implementing Gaussian Regression. How to solve it?
body: <p>I am running a Gaussian regression in Python. My data set has the shape of (10000,5). But when I try to fit the model I get an error:</p>
  
  <p><code>AttributeError: 'list' object has no attribute 'n_dims'</code></p>
  
  <p>How do I resolve this?</p>
  
  <p>I initially thought this error is being caused as the dimension of my dependent variable might be different from the independent variable. But even after changing them to the same dimension, I am unable to find the problem with the code. Any help will be much appreciated. </p>
  
  <pre><code>import numpy as np
  import pandas as pd
  from sklearn.preprocessing import StandardScaler
  from sklearn.model_selection import train_test_split
  from sklearn.gaussian_process import GaussianProcessRegressor
  from sklearn.gaussian_process.kernels import (RBF, Matern, RationalQuadratic,
                                                ExpSineSquared, DotProduct,
                                                ConstantKernel)
  
  data_set = pd.read_excel(r'XXXXX', sheet = 'Worksheet', header = 0)
  data_set.head()
  test_set = data_set
  
  y = test_set.iloc[:,4]
  test_set.drop(test_set.columns[4], axis = 1, inplace = True)    
  X = test_set 
  x=StandardScaler().fit_transform(X)   
  
  X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=0)
  y_train = np.array(y_train)
  y_test = np.array(y_test)
  y_train = np.reshape(y_train, (7000,1))
  y_test = np.reshape(y_test, (3000,1))
  
  kernels = [1.0 * RBF(length_scale=1.0, length_scale_bounds=(1e-1, 10.0))]
  
  gp = GaussianProcessRegressor(kernel=kernels)   
  gp.fit(X_train, y_train)
  
  </code></pre>
  
  <pre><code>File "&lt;ipython-input-23-5a576449fdb6&gt;", line 1, in &lt;module&gt;
      gp.fit(X_train, y_train)
  
    File "C:\Program Files\Anaconda\lib\site-packages\sklearn\gaussian_process\gpr.py", line 203, in fit
      if self.optimizer is not None and self.kernel_.n_dims &gt; 0:
  
  AttributeError: 'list' object has no attribute 'n_dims'
  </code></pre>