Is kernel regression the same as linear kernel regression?
<p>i wanted to code the linear kernel regression in sklearn so i made this code :  </p>

<pre><code>model = LinearRegression()
weights = rbf_kernel(X_train,X_test)

for i in range(weights.shape[1]):
    model.fit(X_train,y_train,weights[:,i])
    model.predict(X_test[i])
</code></pre>

<p>then i found that there is KernelRidge in sklearn :</p>

<pre><code>model = KernelRidge(kernel='rbf')

model.fit(X_train,y_train)

pred = model.predict(X_train)
</code></pre>

<p>my question is:<br>
1-what is the difference between these 2 codes?
2-in model.fit() that come after KernelRidge(), i found in the documentation that  i can add a third argument "weight" to fit() function, i would i do that if i already applied a kernel function to the model?</p>