I'm the first person to do regression analysis on python.
If you proceed as per the reference site, the error message
AttributeError
'LinearRegression' object has no attribute 'pledict' appears.
Please tell me the solution.
Here's the source code
import pandas as pd
import matplotlib.pyplot asplt
import time
from sklearn.linear_model import LinearRegression
import seaborn
df = pd.read_csv("path of csv")
time.sleep(0.5)
x = df [['x']]
y = df [['y']]
model=LinearRegression()
model.fit(x,y)
plt.plot(x,y,'o')
plt.plot(x,model.pledict(x))<<<Error here
plt.show()
Additional
Rewrite the same amount and
in the same place.
AttributeError
'DataFrame' object has no attribute 'model' appears
The spelling is different.
plt.plot(x,model.pledict(x))<<<Error here
plt.plot(x,model.predict(x))<<<Error here
© 2024 OneMinuteCode. All rights reserved.