Olá, poderia me ajudar? O código apresenta o seguinte erro:
UnboundLocalError Traceback (most recent call last)
Untitled-1.ipynb Cell 37' in <cell line: 4>()
6 previstos = prever(df['Area'], theta1, theta0)
7 print(erro_quadratico_medio(previstos, df['Valor']))
----> 8 theta0, theta1 = gradienteDescendente(theta0, theta1, df['Area'], df['Valor'], 0.01)
Untitled-1.ipynb Cell 34' in gradienteDescendente(tetha0, theta1, X, y, alpha)
1 def gradienteDescendente(tetha0, theta1, X, y, alpha):
2 dtheta0, dtheta1 = derivada(tetha0, theta1, X, y)
----> 3 theta0 -= alpha * dtheta0
4 theta1 -= alpha * dtheta1
6 return theta0, theta1
UnboundLocalError: local variable 'theta0' referenced before assignment