Cv_results["estimator"]?

Hi all,

I have a question regarding this line of code:

weights = pd.DataFrame(
[est.coef_ for est in cv_result[“estimator”]], columns=data.columns)

After I saw what is doing i understand the outcome but what i dont underdstand is why when i want to see what are you iterating:

cv_result[“estimator”]

I see only this:

[LinearRegression(),
LinearRegression(),
LinearRegression(),
LinearRegression(),
LinearRegression(),
LinearRegression(),
LinearRegression(),
LinearRegression(),
LinearRegression(),
LinearRegression()]

I am quite sure i am missing something but i dont know what.

Thanks a lot in advance! :pray:

Were you expecting to see the value of the coefficients when doing cv_result['estimator']? When you see an output inside the Jupyter notebook it does not give you all the information about the object.

For example in the snippet of code below, the output of the numpy array shows only its values but not its dtype:
image

This is very similar in the LinearRegression case.

Pro tip: you can use Markdown, in particular for code to make things more readable, for example you can have a look at Basic writing and formatting syntax - GitHub Docs

Thanks