Защо получавам грешка: name 'LinearRegression' is not defined?
Знам, че прекалявам с койте въпроси, но защо ми дава грешка:
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-15-8d60082b3cbb> in <module>() ----> 1 model = LinearRegression() NameError: name 'LinearRegression' is not defined
това ми е кода:
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def simulate_points(a, b, max_noise):
x = np.linspace(-2, 3, 15)
y = a * x + b
y_noise = np.random.uniform(-max_noise, max_noise, len(x))
y += y_noise
return [x, y]
points = simulate_points(2, 5, 2.5)
plt.scatter(points[0], points[1])
plt.show()
model = LinearRegression()