I am working on traffic violation data set which contains 36 columns(variable). I have two dependent variables out of this.


id, description, age, sex    alcohol     vehicle     violation level Accident

120   speed      28    M       Yes         car             severe       yes                                                                                                                                      
122   win-tint   35    F       No         truck            Medium       no                          
123   left-turn  26    M       No          car             light        no                                                                                                                 
124  failure-veh 28    M       No          car             severe       yes

The dependent variables are "violation level" and "accident".

violation level has 3 classes -- sever medium light

Accident has 2 levels -- Yes No

I want to predict both violation level and accident. I think this can be multitarget prediction.

Can someone help me which algorithm is good for this? I have seen some articles suggesting scikit- multiout put classification and neural network with multiple out put layers.

Or Can I go ahead with two models?

predicting the traffic violation level.

Predicting the accidents using the violation levels.

Basically I am trying to predict violation levels and then predicting how these violations contribute to accidents.

Any help would be appreciated.


2 Answers 2


At first the way you explained it, it sounded to me it is a multilabel classification (like e.g. CelebA) and approaches I have used for there was coming to my mind. Also I thought it is hierarchical classification because you have subcategories in your dependent variable. But at the end you mention that you want to

Predicting the accidents using the violation levels.

Aren't then your dependent variables (violation level , and accident) already correlated/related to each other? It seems to me that you do not have two independent dependent variable. I would try to reduce the problem to a simple multiclass classification, in your case 6 as follows (assuming you have these explicit labels for each data point):

  1. Severe-Yes
  2. Severe-No
  3. Medium-Yes
  4. Medium-No
  5. Light-Yes
  6. Light-No

Then you have 6 classes/labels to build a model e.g. Gradient Boosting Tree or Neural Network.

  • $\begingroup$ This can be multiclas classification. I don't have explicit labels for each point. I have two queries here. First predicting the traffic violation level. Second, I'm trying to find the correlation between violation level and accidents as means of predicting the occurrence of traffic accidents" $\endgroup$ Aug 10, 2018 at 8:22
  • $\begingroup$ I think you are yet not clear again! This Can or Cannot be multiclas classification? What do you mean you do not have labels for each point? What do you have then? Probabilities or..? Is this even supervised? Try to edit then your question as clear as you can to get good answers. Try to show a couple lines of your dataset. $\endgroup$ Aug 10, 2018 at 8:26
  • $\begingroup$ I have edited the question to add few lines of data. Can you please check it now? $\endgroup$ Aug 10, 2018 at 8:43

This problem can be solved as a multi-task learning problem. This means that you have a common base model with 2 "heads" (final parts that are responsible for outputting the class). There are examples when multi-task learning was beneficial for all tasks in the problem. Like here.

Not sure about Scikit-Learn capabilities for multi-task learning, but with neural nets that's fairly easy. You just have to build a model (in your case a multi-layered perceptron) with 2 outputs instead of 1.


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.