agosiewska / SAFE_examples

5 stars 4 forks source link

Coefficients of a regression model #1

Closed anejad closed 5 years ago

anejad commented 5 years ago

I want to extract the coefficients of my linear regression model from the pipeline that has Safe Transformer applied to it. I managed to extract coefficients using something like this: pipe.steps[1][1].coef_ However, when I extract my model coefficients the number of features is greater than number of features in the data itself. For example for Apartment.csv example, model is trained on 13 features but model has 173 coefficients. Can you tell me what is going on? Thanks!

agosiewska commented 5 years ago

Hello, the increased number of coefficients is a consequence of how the SAFE method works. Numeric variables are transformed into several binary variables, therefore transformed data set consists of more features than the original. That is why your model (trained on transformed features) has more coefficients.

I hope I have answered your doubts. If not, I will be happy to answer any further questions.

If you would like more details, here is a repository with the implementation of SAFE ML: https://github.com/ModelOriented/SAFE And arxiv preprint: https://arxiv.org/abs/1902.11035

anejad commented 5 years ago

Oh I see, so I am guessing there is no way of assessing coefficients of original dataset. Thank you for your response.