What is correct interpretation of "p" in R(squared) adjusted formula? I was looking at a regression problem I have, and I'm using the R(squared) metric to assess my model, in addition to other metrics. I'm aware that R(squared) will always increase as the number of features increase/add more features, which I'm also using the R(squared) adjusted metric to account for this change.
Using the following formula, I'm having doubts about the actual value of p.

If I have a number of independent variables (a mix between numerical and categorical), should the value of p be based on the number of variables after processing categorical features or not?
Lets say I have 3 variables: Num_1, Cat_1, Cat_2. And Cat_1 is a binary categorical variable, and Cat_2 has 3 unique values. Would the value of p be 4? Since Cat_2 gets encoded into 2 variables. Or is it 3? Not accounting encoding.

It's the number of independent variables entering into the regression model.; therefore it's the number after any preprocessing step performed. In this case it is 4, assuming you're using dummy-encoding as per your examples suggest.
