Skip to content

Instantly share code, notes, and snippets.

@aneury1
Created February 27, 2023 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aneury1/ab861c31dc3bfc7c060e09149f2b44d8 to your computer and use it in GitHub Desktop.
Save aneury1/ab861c31dc3bfc7c060e09149f2b44d8 to your computer and use it in GitHub Desktop.
# recuerda importar.
def AlgorithmLinearRegresion():
x = col_weight
y = col_weight2
X = x.reshape(-1, 1)
model = LinearRegression()
model.fit(X, y)
x_test = np.array([6]).reshape(-1, 1)
y_pred = model.predict(x_test)
plt.scatter(x, y)
plt.plot(x, model.predict(X))
plt.xlabel('Causa')
plt.ylabel('Vulnerable')
plt.title('Regresion Linear utilizando(Causa,Vulnerable)')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment