I have a problem with my code: I want to use Sklearn's SVR
method but mark an error saying that 'SVR' is not a callable object when I use the SVR()
function.
import numpy as np
from sklearn.svm import SVR
This is how I use the function SVR
and the parameters I give it:
svr_lin = SVR(kernel='linear', C=1e3)
svr_poli = SVR(kernel='poly', C=1e3, degree = 2)
svr_rbf = SVR(kernel='rbf', C=1e3, gamma=0.1)
This is how the error marks me:
<ipython-input-1-6f926795cb9b> in prediccion(fechas, precios, x) 24 svr_rbf = SVR(kernel='rbf', C=1e3, gamma=0.1) 25 26 svr_lin(fechas, precios) <---- 27 svr_poli(fechas, precios) 28 svr_rbf(fechas, precios) TypeError: 'SVR' object is not callable
The same thing also happens if I want to use SVC instead of SVR. I do not know what is due and I hope someone can help me.