I am just posting with reference to another thread I read and would appreciate if anybody could offer some help. I am training a multi-label, multi class classifier in keras where my data has multiple categorical data attached to the main data. For one sample, there may be several categories attached, age, sex etc... up to 6-7 categorical data. I have built an MLP to classify the data as follows:

onehot <- data.frame(to_categorical(onehot$Age, 7), 
to_categorical(onehot$Sex, 4, onehot[,1:5000] **(number of 

The data is split (code not shown)and network run according to the following code:

model <- keras_model_sequential()

model %>%
   layer_dense(units=150, activation = 'relu', input_shape = 5000) %>%  
   layer_dense(units = 64, activation = "relu") %>%   
   layer_dense(units=ncol(trainingtarget1), activation = "sigmoid")
# sigmoid for multi-class and multi-label classification (training 
target is all categorical data)

model %>% keras::compile(loss='binary_crossentropy',
history <- model%>% 
   fit(as.matrix(training1), # input, the first independent variables
       as.matrix(trainingtarget1), # input, Metadata
       validation_split = 0.15,
       callbacks = list(early_stop, print_dot_callback))

The model performs well and with decent accuracy (~90%). I am able to view the predictions and build confusion matrices for each individual label (age, sex etc)... However, coming of the back of the post I linked above:

I would like to be able to understand not just which features and weights are important in determining the individual categories (age, sex) but also understand the relationships and patterns the neural network identifies within these categories also. For example, are there features that are specifically prevalent in younger ages in males compared to females for example.

I am stuck on how to identify these patterns and the features that are contributing to these sorts of relationships and not just the features that contribute to individual categories. Any help would be much appreciated!



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.