1
$\begingroup$

I am using keras neural networks for a binary classification task. I have a large dataset with 19 columns. Each of these columns is of binary type, and therefore the entire dataset is just 1s and 0s, like so (obviously this is not the entire dataset, which has 19 columns and many more rows): enter image description here

I want to make 19 predictions, one for each column, where the other 18 are used as independent variables. So essentially, first I'll make col 1 the target, using the other 18 columns to predict it. Then I'll make col 2 the target and use the other 18 to predict it etc etc...until column 19. Is there any way to do this effectively without making 19 separate models for each column? Thanks!

$\endgroup$
  • 1
    $\begingroup$ You will have to make 19 models there is not other way because if you use the target variable in the input it will always give 100 % accuracy and the model would expect the input which you want to predict (which obviously can't be done) $\endgroup$ – Kaustubh Jun 25 '18 at 5:09
  • 1
    $\begingroup$ If I got the Question correctly, then you are skipping a col and rebuilding a model right maybe to introduce diversity.. In this case we do need to build different models as the changes made for the train and the test need to be the same or else the model will throw some tracebacks $\endgroup$ – Aditya Jun 25 '18 at 7:03
1
$\begingroup$

If you create 19 models, each model will learn weights corresponding to predictors and target variable values.

For example- When you create one model by taking col1 as target, the model will learn weights for giving output col1. When you take another column, lets say col2 as target, if you use the previous model, it won't identify the difference between col1 and col2 (i.e., target) as your data is binary. The model will continue to learn weights for each column, but it won't be the correct one as it will be result of learning all target columns.

You could have used multi-label classification if you wanted to predict different targets at same time using same predictors for each target. Since this is not the case, the only way for getting 19 predictions is to create 19 different models, one for each column as target.

$\endgroup$

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.