I want to do a single regression analysis with python.

Asked 2 years ago, Updated 2 years ago, 91 views

I'd like to do a single regression analysis on python's jupyter notebook, but one of the data is saved as df1, but the csv on the other x axis is not saved, so I'd like to do a single regression analysis as [1,2,3,........], but I don't know how to do it.

from sklearn.linear_model import LinearRegression

lr = LinearRegression()
lr.fit(x,y1)
Name Error Traceback (most recent call last)
<ipython-input-91-bc6b4eab4f87>in<module>
     2
     3 lr = LinearRegression()
---->4 lr.fit(x,y1)

NameError: name 'x' is not defined

I don't know how to make the part that corresponds to x.

src=

python csv

2022-09-29 20:15

1 Answers

The error indicates that x is not defined. You must define X before fit (run cells that are data frames assigned to X)


2022-09-29 20:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.