bio-ontology-research-group / deepgoplus

DeepGO with GOPlus axioms
BSD 3-Clause "New" or "Revised" License
89 stars 41 forks source link

ValueError: Length of values does not match length of index #22

Closed Mohamed-ElhajAbdou closed 3 years ago

Mohamed-ElhajAbdou commented 4 years ago

i got this error when im go back to deep_go_plus.py

**ValueError: Length of values does not match length of index

    154     test_df['labels'] = list(test_labels)
    155     print ('len(test_df)', len (  test_df ))
**--> 156     test_df['preds'] = list(preds)**
    157 
    158     logging.info('Saving predictions')**

here is from my investigation tracing i had set the training_steps =5 valid_steps = 5 number of epoch = 1 as a result of that the length of prediction --->>>> len(preds)=5 and the size of preds matrix = 4774 X 5 but df_test length = 71 and the size of df_test = 71 rows × 8 columns so as a result of the there is incompatibility or no matching between the lengths (my understanding and my opinion from this error )

so kindly can you tell me the source of mistake that i had made thanks

coolmaksat commented 4 years ago

The problem is that training_steps and valid_steps need to be computed from the lengths of train and valid data, respectively. I suggest you use the original code. You can change the number of epochs if you like.

Mohamed-ElhajAbdou commented 4 years ago

i made it, and it still display the error also i wanted to mention that i has changed the model params as follows params = { 'max_kernel': 20, 'initializer': 'glorot_normal', 'dense_depth': 0, 'nb_filters': 2, 'optimizer': Adam(lr=3e-4), 'loss': 'binary_crossentropy' } is that a reasion for this error

coolmaksat commented 4 years ago

This error is because preds array does not have the same size as the test_df data frame size