0
$\begingroup$

I have a set of simulations in which an event may or may not happen. I recorded the time the event occurs and whether it does.

I would like to perform regression on the time variable, including whether the event happens at all. I suppose the easiest approach is to encode the missing value as NaN, but that opens a can of worms.

I imagine Linear Regression is out of the question, because there is no way it could generate a NaN.

I suppose a Decision Tree would also not work, because when establishing the value of a leaf it would calculate the average, which would be NaN if even one of the values is a NaN. Similar deal with Random Forests.

Question: are there techniques to deal with this situation? In particular, I am using Python.

Thanks in advance!

$\endgroup$
  • $\begingroup$ Survival analysis (if the event can occur but once), or more generally, event history analysis sounds like the appropriate technique, but to say any more, we would need more detail about the problem. $\endgroup$ – The Laconic Dec 20 '18 at 2:54
0
$\begingroup$

No matter how you structure the problem, you have to have a numerical representation of the NaN (no occurrence of the event). Regression is a lot harder problem by default and thus having a value such as 0 to encode the NaN may be tough to address (and it doesn't make much sense, either). What I would do is treat the problem as both classification (a binary classifier to determine whether the event occurs or not) and regression (if it occurs, what is the value).

$\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.