Last answered:

30 Jun 2022

Posted on:

29 Jun 2022


Issues with modified LinearRegression class

I am having two issues with the modified LinearRegression class you provided.

  1. when I try it with my own data, it gives an error as below:
    Here's the data.head()

2) Second, with the provided data, I can extract the t-values with the following command but the structure of the array looks different from the one for p-values. Thus, it doesn't work when I try to add it to the output summary table.


Any help appreciated.

1 answers ( 0 marked as helpful)
Posted on:

30 Jun 2022


Hey Jahurul,

Thank you for your question!

Regarding the firs problem, the error on your screenshot states that stat is not defined. Are you sure you have imported the scipy.stats library as stat before defining the LinearRegression() class?

Regarding the second problem, you can reshape the array as follows:

Hope this helps!

Kind regards,
365 Hristina

Submit an answer