Given the difference between one-hot encoding and dummy coding, is the pandas.get_dummies
method one-hot encoding when using default parameters (i.e. drop_fir
First question: yes, pd.get_dummies()
is one-hot encoding in its default state; see example below, from pd.get_dummies docs:
s = pd.Series(list('abca'))
pd.get_dummies(s, drop_first=False)
Second question: [edited now that OP includes code example] yes, if you are one-hot encoding the inputs to a logistic regression model, it is appropriate to skip the intercept.