hkmztrk / DeepDTA

215 stars 107 forks source link

How to open Y correctly? #17

Closed ZhongYueer closed 4 years ago

ZhongYueer commented 4 years ago

Hi, I am using your code to learn how to predict interactions between drugs and proteins. I have a problem about how to open the file Y. It is random code when I open the file Y. I have tried many methods to solve it, but these methods do not work. So how to open Y correctly? Should I decode it or open it on Linux?

hkmztrk commented 4 years ago

@ZhongYueer, it is a pickle file, you can open it as below and can save it to txt if you want to look inside.

import pickle
import numpy as np

Y = pickle.load(open("Y", "rb"))  # Y = pickle.load(open("Y", "rb"), encoding='latin1')
label_row_inds, label_col_inds = np.where(np.isnan(Y)==False)
ZhongYueer commented 4 years ago

Thank you for your reply!Your codes and reply gives me a lot of help. Best wishes!

hkmztrk commented 4 years ago

you're welcome @ZhongYueer!