fit() got an unexpected keyword argument 'kernel'
fakhrulfa opened this issue · 2 comments
Hai!
I get an issue when i trying to use this packages when i run :
model = LSSVR()
model.fit(X_train, y_train, kernel='linear')
y_hat = model.predict(X_test)
y_hat = model.predict(X_test)
print('LSSVR\nMSE', mean_squared_error(y_test, y_hat))
print('R2 ',model.score(X_test, y_test))
i got an error like this :
TypeError Traceback (most recent call last)
in
1 model = LSSVR()
----> 2 model.fit(X_train, y_train, kernel='linear')
3 y_hat = model.predict(X_test)
4 y_hat = model.predict(X_test)
5 print('LSSVR\nMSE', mean_squared_error(y_test, y_hat))
TypeError: fit() got an unexpected keyword argument 'kernel'
how can i solve it?
thanks.
The files are not updated. You should pass the kernel, C and gamma(if it is an RBF kernel) into the LSSVR itself.
model = LSSVR(kernel='linear', C = 1.0)
model.fit(X_train, y_train)
y_hat = model.predict(X_test)
I'm sorry, I forgot about this issue. So, @aiarjun is right, I made a mistake in the example file. You must pass the params into the LSSVR()
. Also, you can use the GridSearchCV()
and pass a dictionary with parameters.