Created
September 15, 2020 05:20
-
-
Save rodrigols89/bb722878ef8068384dec108d04210dcc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def createRegression(samples, variavel_numbers, n_noise): | |
| from sklearn.datasets import make_regression | |
| x, y = make_regression(n_samples=samples, n_features=variavel_numbers, noise=n_noise) | |
| return x, y | |
| if __name__ =='__main__': | |
| from matplotlib import pyplot as plt | |
| reg = createRegression(200, 1, 30) | |
| plt.figure(figsize=(10, 7)) | |
| plt.scatter(*reg) | |
| plt.title('Linear Regression Sample with Scikit-Learn') | |
| plt.savefig('../images/plot-04.png', format='png') | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment