2
$\begingroup$

I have two columns, [Date Activated] and [Date Closed]. One is the date an account was activated, and the other column is the date an account is closed.

There are three scenarios:

Case 1 (1/6 data) Closed Account: An account has an activated and closed date

  • Will result in a value


Case 2 (1/6 data) Active Account: An account has an activated date, but no close date

  • Will result in NaT, so it will have to be imputed.


Case 3 (2/3 of the data) Never Activated Account: An account that has neither an activated or closed date.

  • Will result in NaT, so it will have to be imputed


For case 2, Should I just take the difference between the current date and date activated for those active accounts?

For case 3, what should I impute the NaT values with? The data isn't missing, it just doesn't have dates since it was never activated and thus never closed. Imputing it with 0's sounds like it would throw off the data for the accounts that were activated and closed on the same day and within a few days.

$\endgroup$
1
  • $\begingroup$ Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. $\endgroup$
    – Community Bot
    Nov 5, 2021 at 4:25

1 Answer 1

1
$\begingroup$

If the activation and/or closing of an account hasn't occurred, the associated date values will be null. There's no right way of converting a null placeholder to a value (unless you already have a sensible default to replace it with).

In your case, I'd transform the date features to duration features to capture the information you are trying to work with. Let Da and Dc be the number of days elapsed since an account was activated and closed, respectively. For the events captured today, I would start from Da/Dc=1 and for missing events Da/Dc=0. Both of these features are easy to calculate in Case 1. For the Case 2, Dc will be 0, similarly, for the Case 3, both Da and Dc will be zero.

In order to tell apart the events that just occurred (Da/Dc=1) from those that occurred a day ago (Da/Dc=2) vs those that haven't occurred so far (Da/Dc=0) as both have a gap of 1 day, I would create additional categorical feature Account Status which will have values Inactive/Active/Closed corresponding to your cases 3, 2, and 1 respectively.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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