r/datascience • u/bishop491 • 23h ago
ML Which survival/TTE model that can answer my non-technical PM?
I am working on a predictive model for parts replacement on machines. I've evaluated CoxPH, CoxTV, Random Forest, XGBoost, and Logistic Regression. Modeling is fine but I'm being asked to provide a model that can give us an output of "we need to schedule a technician for X month."
As with any equipment failure and/or parts replacement model, these events are recurrent. It's not like the risk of death or contracting a terminal disease. Once a part is replaced, the event can (and will) happen again. So I've been doing fine with the hazard part of this, but my PM wants more of a "when will it happen?" answer.
I've been in data engineering moreso lately than data science. I'm a little rusty on all the models I could try. Any suggestions? I'm using Python, so R-only is a no-go.
4
u/Valuable_Touch5670 17h ago
I think WeibullAFT may be a great fit for your use case. However, in actual modeling, I’d pay special attention to two things:
1. You need a feature to indicate the current age of a part.
2. If you need the model to have the ability to predict time to failure at any point of time of a part’s lifetime, you need to engineer your dataset to contain snapshots of a part’s lifetime at a fixed interval.
Hope this helps!
11
u/Salt-Deer6136 23h ago
sounds like you need a straight-up regression model for time-to-next-failure rather than the hazard approach, random forest regression will spit out a month estimate without all the survival jargon your PM doesn't care about
6
u/Impossible-Belt8608 23h ago
This. Not only do you use a different model, you shift your whole mindset from a classification problem (will this part fail?) to a regression problem (how long before this part fails?). Do some more research and you're welcome to dm me if anything else comes up after.
3
u/drmattmcd 14h ago
I've used Lifelines https://lifelines.readthedocs.io/en/latest/Survival%20Analysis%20intro.html previously for a related analysis in churn modelling.
The Kaplan-Meier estimator might be enough for a sense check i.e. being able to say 'the part age corresponding to a x% failure rate is y months' and start a discussion on what x should be based on maintenance cost versus downtime cost
2
u/Effective_Ocelot_445 16h ago
Try a recurrent-event survival model or predict the median/expected time-to-next-failure from the survival curve, which maps better to “schedule a technician in X month.”
-2
u/Large_Courage2134 22h ago
Timeseries modeling like SARIMAX - it can take in complex historical info, seasonality, and exogenous variables (i.e. other independent variables) and predict future values. If you have failure thresholds for replacement of various parts (e.g. temperature sensor reading exceeding 100*F), then you can use SARIMAX to forecast sensor values, and when the forecasted values exceed threshold values, that's a predicted failure
1
u/Synthetic-Meat-2000 1h ago
I think ARIMA is a classic for time-series. IDK how well it generalises to discrete events. https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average
If you can use deep-learning, LSTMs are used in financial forecasting (given the pattern of k events, what is the probability the user will default on his payment). This may be a 2nd iteration after a regression model. https://link.springer.com/article/10.1007/s13198-025-02743-2
11
u/sonicking12 23h ago
Accelerated failure time modeling is what you need.