I have a following toy dataset example with target variable repair_type

id  |  car  | mileage | repair_type | sex | age
 1  | Honda | 12000   |  engine     | 1   | 50
 1  | Honda | 12000   |  suspension | 1   | 50
 1  | Honda | 15000   |  brakes     | 1   | 50

Basically the dataset represents that some customer with id 1 at mileage 12000 repaired engine and suspension. After a while he returned and at mileage 15000 repaired brakes. I cleary understand that mileage and repair_type should thread as time series data. Also i have a categorical and numeric variables. Should i recombine a dataset? Should every records of customer be transposed as a single record ? In that case, with mixed time of data, what ml algoritm should i try to predict repair_type


1 Answer 1


If I got it right, the application of your model would be predicting the most likely repair type given characteristics like: car brand, mileage...

The format of your dataset should be still valid for your classification model, but as you mentioned, informing the evolution of that car (belonging to a customer) is also necessary, but not changing it to a time series data (which sampling frequency? how many time samples?...) but informing, instead, the past repairs already made to the car.

What I would try, keeping the dataset format, is:

  • adding an additional categorical attribute informing past repair types already made to the car when a new one is made, andanother attribute informing the mileage passed since the last repair (checking whether it is highly correlated or not with other variables etc), so you could have something like:
id car mileage past_repair_types mileage_since_last_repair sex age repair_type
1 Honda 12000 nothing 0 1 50 engine
1 Honda 12000 nothing 0 1 50 suspension
1 Honda 15000 engine&suspension 3000 1 50 brakes

For classification tasks with mixed data types, decision-tree based algorithms should work fine, you can try XGBoost, and you can have a look at this worked out example.

  • $\begingroup$ Thank you for your answer! $\endgroup$ Aug 13, 2021 at 4:45

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.