I am trying to build a Multi label classification model, having dataset with different input numerical values and specific label...


Value Label

35 X

35.8 X

29 Y

29.8 Y

39 AA

41 CB

So depending on input numerical value the model should specify its label....please note that the input values won't necessarily follow exact dataset values....eg dataset has 35 and 34.8 as input values with X as label. So if model has 35.4 as input label, the X should be output label. Bottom line is that the output label is based on range of input values instead of fixed one..

Can anyone help me with quick solution (example Jupyter notebook will be highly appreciated)


For a simple multi layer perceptron, you can refer to here: https://www.kaggle.com/fchollet/simple-deep-mlp-with-keras

This is a great resource for kerad multi input label classification. Also, here is a few reminders for implementing such classification model.

One hot encoding

In the sample data you provided, it seems like you are using raw numbers as input. This will create unnecessary complications for the model. A better approach will be to encode them into a vector with 0 in all except one index with 1. The index will be the numerical value you are encoding. For example, 1 will be 01000000... Till end of your range of input, and 2 will be 001000 and so on. If you have decimal values, then this approach isn't for you. However you should still scale down your input to something smaller like 0-1.

output encoding

The output seems to be text, which cannot be done and also complicates the problem. Instead you can also use one hot encoding for the output. For example, let A be 0, B be 1, C be 2... AA be 27.... Until your list ends. And then use one hot encoding to encode them to vector of 0 and 1.

Hope I can help you.


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.