campusx-official / 100-days-of-machine-learning

1.26k stars 1.66k forks source link

Error: name 'final' is not defined problem fixed #38

Open fmahadyBD opened 10 months ago

fmahadyBD commented 10 months ago

Sir, the final variable was not found when run it. Because, we assigning the final variable in the next line. Instead, we used it in previous line.

Error code:

z_final = lr.predict(   final  ).reshape(10,10)
z = z_final
final = np.vstack((xGrid.ravel().reshape(1,100),yGrid.ravel().reshape(1,100))).T

Fixed Error code:

final = np.vstack((xGrid.ravel().reshape(1,100),yGrid.ravel().reshape(1,100))).T
z_final = lr.predict(   final  ).reshape(10,10)
z = z_final