Half classification, half regression model? I'm trying to implement a model that predicts whether a user pays for something, and if so, how long it takes for them to pay. I intuit the output of this being either a label (0) or a real number. Is there such thing as a half classification, half regression model? Or am I misinterpreting the problem?
Edit: to clarify, paying or not paying in a certain time frame makes a difference, with those not paying effectively having a False/0 label. The more detailed context is that this is a prepayment model. (I see how my original explanation may be confusing).
 A: You actually have two problems here, and you can treat them like that.

whether a user pays for something

You probably want to model a Bernoulli trial here.
You'll have a probability $p(X=x) \in(0,1)$.
So you have a loss function $\mathcal L_B(y,\hat y)=-y\log(\hat y) - (1-y)\log(1-\hat y)$, where $\hat y = f(x)$ is the probability that the user paid for something.

and if so, how long it takes for them to pay

This one results in a time $\tau(X=x) \in (0,+ \infty)$.
You can model this as an exponential, that will lead us to the following loss function: $\mathcal L_E(t,\hat t)=t\hat t - \log\hat t$, where $\hat t = 1/g(x)$.
So, the total loss-function (for a datum) is:
$$\mathcal L = \mathcal L_B + y\mathcal L_E$$
You can use the actual $y$ in training, which implies that
$$\mathcal L=\begin{cases}\mathcal L_B, \quad\text{for} \quad y=0 \\\mathcal L_B + \mathcal L_E, \quad\text{for} \quad y=1\end{cases}$$
This basically means estimating two separate models, unless $g$ and $f$ share parameters (if we are talking about neural networks, that can be a sensible choice, depending on the nature of $x$).
A: Interesting question, it depends on how complicated you want to get but in the most straight forward models no. Assuming we stick to something like simple linear regression here are three options:

*

*Do the first in sequence: first fit whether they bought, then fit the time on only the data where that's applicable. This is probably the best method.

*In your training set, assign everyone who didn't buy something a negative time (say -1). Then, fit to time only and assume that anyone with any negative time has not bought something.

*Are you happy with discrete time data? If so, you could do regression onto the set of ([didn't buy], [bought, time1], [bought, time2],...). This will have some issues, like the fact that you have single a massively over represented category but you can try to fix that with weighting.

In general I would suggest just doing the first method, it would be hard to fit "simultaneously" without having to do some kind of reweighting.
