I want to develop a ML model which will allow my company to highlight employees which are at a risk of leaving the business, based on a variety of parameters such as performance, absence rates, location, age, team manager etc. We have a fairly diverse database of individuals who have already left the business, with values for each of the inputs which can be used to train the model. The output is a simple 1 or 0: based on all of the inputs, either an individual is 'at risk' or 'not at risk' of leaving, with no immediate requirement for any indication of the degree of risk.

I am somewhat of a ML newbie, but having researched the various types of ML models, I cannot find any specific information which relates to training models with datasets where there are combinations of numerical and categorical data. I have looked at examples of similar model requirements which have used k-NN and SVM models, but I cannot find definite clarification on how to approach this task. Worth noting that I code in python and matlab.

Any input would be greatly appreciated.

  • $\begingroup$ my bet would be a CART, but various models, eg SVMs, ANNs have proven robust with mixed data $\endgroup$
    – Nikos M.
    Oct 11 '21 at 15:50

There are some ML models which use both categorical and numerical data

  • Decision trees(with bagging),
  • Random forest(with bagging & random subspace)
  • Naive Bayes(numeric by Gaussian distribution or kernel density estimation)
  • KNN based approach
  • Ensemble Techniques
  • linear regression

Note: you can always use different encoding techniques to transform categorical data into numeric and vice versa based on the ML model you choose


Even though virtually any supervised classification algorithm can be used when having categorical features by applying some encoding technique, my first thought is using Catboost, an algorithm specially designed just for handling categorical features without a necessary explicit preprocessing/encoding phase. In short this algorithm will use an adaptation of target encoding and you can check details here:


From Yandex docs:

CatBoost is an algorithm for gradient boosting on decision trees. It is developed by Yandex researchers and engineers, and is used for search, recommendation systems, personal assistant, self-driving cars, weather prediction and many other tasks at Yandex and in other companies, including CERN, Cloudflare, Careem taxi. It is in open-source and can be used by anyone.


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.