Linear Regression model error: TypeError: float() argument must be a string or a number, not 'method'

Viewed 39

I am try to fit a liner regression model. I am geeting this error: TypeError: float() argument must be a string or a number, not 'method'. The data type of all the colums is float64.

Data ussed for the model:

    ASSETS  REVENUES    AUDIT_FEES
0   78485.38    55098.67    391.9
1   259054.6    324518.85   599.17
2   545000.86   661234.06   1201.83
3   290087.75   19177.09    413.37
4   327593.87   406270.92   691.48

X = Audit_Data[['ASSETS','REVENUES']]
Y = Audit_Data['AUDIT_FEES']

And the code is:

Model_reg = linear_model.LinearRegression()
Model_reg.fit(X,Y)

Can you please let me know what is the issue?

1 Answers

Did you try to import a linear_model, first?

Like this:

from sklearn.linear_model import LinearRegression

and then apply

Model_reg = LinearRegression().fit(X,Y)
Related