I'm relatively new to regression analysis in Python. I'm running a logistic regression on a dataset in a dataframe using the Statsmodels package.
I've seen several examples, including the one linked below, in which a constant column (e.g. 'intercept') is added to the dataset and populated with 1.0 for every row. And then the intercept variable is included as a parameter in the regression analysis.
My question is: what is the purpose of this, and is it necessary? (How do I know if it's necessary?)
(Reference: Logistic Regression: Scikit Learn vs Statsmodels)