Last active
August 28, 2019 21:23
-
-
Save n0obcoder/f2f3131e35aaa5146976480429978a09 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
| # Defining the range of 'x', the independent variable | |
| x_range = [-2000, 2000] | |
| # Defining the extent of noise, which would be added to both the dependent as well as the independent variable | |
| deviation = 100 | |
| # For the data points to roughly fall on a staright line, we need to define the slope and the intercept of that line | |
| # Let's intoduce some randomness in the slope and intercept selection process | |
| m_synthetic = random.randint(-100, 100)/100. # m_synthetic is real number from the set(-1.0, -0.99, -0.98 ...., 0.98, 0.99, 1.0) | |
| c_synthetic = random.randint(-10, 10) # c_synthetic is an integer from the set(-10, -9, -8 ..., 8, 9, 10) | |
| print('\nm_synthetic: {}'.format(m_synthetic)) | |
| print('c_synthetic: {}'.format(c_synthetic)) |
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
| m_synthetic: -0.67 | |
| c_synthetic: 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment