1
$\begingroup$

I have a time-series dataset and I want to derive a new feature based on a date column which I believe might improve my predictive model. The feature is if it's weekday or weekend.

I am not sure how to create this for modeling purposes. Do I represent it as a boolean function or a numerical one (1/0) or just add 2 new features (weekday, weekend) and represent them as 1 and nan?

$\endgroup$

1 Answer 1

0
$\begingroup$

Add two new features, dummy variables, that represent the presence or absence of weekend and weekdays. You can create the feature (weekend/weekday) and use one hot encoding to create the two new.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.