Paste Search Dynamic
Recent pastes
predict.predict
  1. import numpy as np
  2. from sklearn.linear_model import LinearRegression
  3. x = np.random.randint(1,100,(1,6)).reshape((-1,1))
  4. y = np.random.randint(1,100,(6,1))
  5. model = LinearRegression()
  6. model.fit(x,y)
  7. r_sq = model.score(x,y)
  8. print('coefficient of determination:', r_sq)
  9. print('intercept:', model.intercept_)
  10. print('slope:', model.coef_)
  11. y_pred = c.predict(x)
  12. print('predicted responce:', y_pred, sep='n')# your code goes here
Parsed in 0.009 seconds