Question

Write a regression model in SCI Kit of learn using python that gets data from a...

  • Write a regression model in SCI Kit of learn using python that gets data from a public API.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.linear_model import linearregression

data=pd.read_csv('data.csv')
x=data.iloc[i,0].values.reshape[-1,1]
y=data.iloc[i,0].values.reshape[-1,1]
lr=LinearRegression()
lr.fit(x,y)
y_pred=lr.predict(x)

plt.scatter(x,y)
plt.plot(y_pred,color="blue")
plt.show()

Explanation:

  • The code is design for  linear regression
  • To run that code user need to install all library in his platform where he run the code .
  • The user should have exel data (data.csv) which file having the data X and Y value store
Add a comment
Know the answer?
Add Answer to:
Write a regression model in SCI Kit of learn using python that gets data from a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT