Created
February 27, 2023 21:26
-
-
Save aneury1/ab861c31dc3bfc7c060e09149f2b44d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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