omarseleem92 / Machine_learning_for_flood_susceptibility

32 stars 8 forks source link

y is not a NumPy array #2

Closed waleedgeo closed 1 year ago

waleedgeo commented 1 year ago

Dear Omar,

First of all, thank you for your great work in this domain. I started studying your codes last week and found some bugs.

The first one is, your y variable is a simple python list, which when supplied to sklearn "train_test_split" gives an error, because of differences in types (X_array is numpy array, y is a simple python list).

Can you please add this line "y = np.array(y)" after X_array.shape line code?

Thanks

omarseleem92 commented 1 year ago

Dear Waleed,

Thank you for your interest in my work and for your message. Yes, I use y as a list, not a Numpy array. It works fine with me as you see in the attached image. If you got an error then converting it to a Numpy array is correct. image

Best regards. Omar

waleedgeo commented 1 year ago

Yes, it seems like due to dependencies differences this might be the case. Thanks for your timely response.

Omar, my CNN model is trained for FSM, how can I get results (i.e., prediction probability?). your CNN code ends at model validation only.

Furthermore, I am working on a hybrid (RF+CNN) model for FSM, however facing issues in dimensions (your CNN produces 4 dim, RF expected 2 dim). Can you share some sources or codes so I can better understand dimensions conversions?

Lastly, let me know if you are available for research paper collaboration (i.e., large-scale FSM using hybrid models)?

Thanks :)

waleedgeo commented 1 year ago

This is the current data shape of my numpy arrays image

omarseleem92 commented 1 year ago

You can use this script to map your study area

1) https://github.com/omarseleem92/flood_susceptibility_mapping/blob/main/Image_based_models/Predictions.ipynb

2) Yes, I would be happy for a collaboration. We can arrange a meeting.

Best regards. Omar