Professional Documents
Culture Documents
Regresion LIneal
Regresion LIneal
import pandas as pd
x=[1, 2, 3, 4, 5, 6]
z=[7]
x=np.array(x)
y=np.array(y)
z=np.array(z)
plt.scatter(x,y,label='data', color='blue')
regresion_lineal = linear_model.LinearRegression()
regresion_lineal.fit(x.reshape(-1,1), y)
pronostico = regresion_lineal.predict(z.reshape(-1,1))
print('\n Pronósticos')
for i in range(len(z)):