Advertisement
gaetanopeti

LinearRegression

Apr 7th, 2021
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import tensorflow as tf
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4.  
  5.  
  6. np.random.seed(1)
  7.  
  8. lin_x = np.arange(0,100,2)  
  9. y = np.true_divide(lin_x,2)
  10. n = np.shape(lin_x)
  11.  
  12. ##adding noise
  13. rand = norm.rvs(loc=0,scale=5,size=n)
  14. x = np.add(lin_x,rand)  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement