SimonNgj / compssa

Comparison of feature techniques
3 stars 1 forks source link

Data #1

Open ArashIranfar opened 4 years ago

ArashIranfar commented 4 years ago

Hi, can you explain how to prepare the .mat files for the codes? As I gather, the .txt files from the JIGSAWS dataset need to be imported into MATLAB, then they should be contacted into a multidimensional array that contains data for different procedures (Suturing, Knot tying, needle passing), different participants (A, B, ...), and some sort of cross-validation indexing. But I can't figure out how to create the files. Can you help me? with files themselves, if you know where I can get them or with instruction on how to make them

lajdzsi commented 3 years ago

Hi there. I would also like to understand the file formats you have used. Thank you in advance for your response!

lajdzsi commented 3 years ago

@ArashIranfar , I managed to generate some files for one of the scripts, if you're interested: To generate the .mat files, you need to define a dictionary, and then use the scipy.io.savemat() function to save that as the .mat file. The key of the dictionary may depend on the given script, I used the PCA script first, and for that you need 'dataA'. Within this, you need to store the id of the user, the attempt_number, the skill, and finally your data. I used another temporary dictionary to actually store and organise the data into, and then just pass that over to the external dictionary. It would look something like this: temp = {} loop for iterating through your data: temp[i] = np.array([ {'user': str(user), 'attempt_id': attempt, 'data': your_data}], dtype=np.object)

dictionary = {'dataA': list(temp.items())}

Sadly, saving this into a .mat file does not solve all your problems. You will need to transform the data you receive from sio.loadmat() in the actual scripts, in order to have the correct dimensions for the functions, but you should be able to figure it out from that point on.

Hope I could help, if it was still relevant for you.

ArashIranfar commented 3 years ago

@lajdzsi Hi there I needed the codes for a project I was working on. So I went on and wrote a version of my own in MATLAB. Thank you for your comment though I appreciate the gesture