2
$\begingroup$

The problem I would like to solve is the following. It's not the usual data science problem (at least for me) so I don't know if my solution is good and I'm open to any comments.

I have a dataset with (categorical) features and a binary label (yes/no) for some observations. My goal is to build a model not to predict what could be the label of a new observation outside of the dataset but to predict what is the probability that actual observations from the dataset change class.

Here is a hypothetical concrete example. You have a dataset with customers from a retail store. There is features (age, location, income, etc.) and a binary label which measure the fact that after the covid years the customer has significantly reduced the level of its spending in the store (yes if it's the case and no if it's not). I would like to build a model to evaluate a probability that a customer who still spend could significantly reduce its spending (because he has similar characteristics to customers who already reduced their spending).

In my opinion, the best approach is a logistic model because the output of such a model is a probability. But maybe I'm wrong or maybe there is other (better) ways for achieving this task ?

$\endgroup$
1
  • 2
    $\begingroup$ Logistic regression seems right to me. $\endgroup$
    – Peter Flom
    Commented Dec 14, 2023 at 11:19

1 Answer 1

1
$\begingroup$

As Peter Flom writes, I would go with logistic regression. You can either model the probability of switching classes, or alternatively and more simply, the probability of being in a target class. In either case, include the current class membership as a predictor, possibly in an interaction with other predictors.

Note that hard dichotomization into two classes when the underlying variable is numeric (spend) loses a lot of information. You might want to directly model future spend, using historic spend as one or multiple predictors (last month's spend, last year's spend, and total lifetime spend could be three different predictors to account for people leaving the platform). Consider spline transformations to capture any nonlinearities.

$\endgroup$
1
  • $\begingroup$ Yes, the idea is to begin with a simple model and add complexity (time series analysis for example) gradually. $\endgroup$
    – Kumpelka
    Commented Dec 14, 2023 at 16:31

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.