eminSerin / NBS-Predict

A prediction-based extension of network-based statistics.
GNU General Public License v3.0
29 stars 6 forks source link

Error using classreg.learning.Linear.prepareDataCR: Empty X or Y not supported. #32

Closed vdkreft closed 1 year ago

vdkreft commented 1 year ago

Hello! I have been recently trying to run your repository utilizing some data of my own. To prepare my data, I made sure that the connectivity matrices were in .mat format, downloaded the respective schaefer brain regions, and created a design matrix. I made sure that none of the files had missing values, and I am certain that none of them do. However, I have been running into the following error:

Error using classreg.learning.Linear.prepareDataCR Empty X or Y not supported.

This simply appears when running the program and leaving it to run for approximately 5 minutes. Here are the parameters I used: Contrast: [1,1,0,0] ML Model: Auto K-Fold: 10 Repeat CV: 10 P-value: 0.01 Seed: 42 CPU Cores: 10 Method: Grid Search

I have also attached the history.mat file and the screen recording of the error in the following google drive link: https://drive.google.com/file/d/1D8b2xyoL1UzV01rP58n4XVGZtCJ2mhFQ/view?usp=sharing

Thank you!

eminSerin commented 1 year ago

Hello,

Thank you for your interest in our toolbox. I apologize for the inconvenience you are experiencing while using it. There could be a few reasons why you are encountering errors.

Firstly, the correlation matrices or design matrix may be structured incorrectly. If you have saved the correlation matrices into .mat files, please ensure that they are set to a variable named "data." Similarly, the design matrix should be a variable named "design." Please refer to the sample data we provided on NITRC and compare its structure to yours.

Secondly, it's possible that your connectivity matrices are already sparse or the effect of interest is too low, leading to no edge surviving feature selection. In such a case, you may increase the p-value and check if it works.

Could you provide me with more information about your sample size and data modality (rs-fMRI connectivity or another modality)? Have you also tried performing the original NBS?

Please keep me updated on your progress.

vdkreft commented 1 year ago

Hello again!

Thank you so much for your quick reply. I have taken a look at the organization of my files and I saw some inconsistencies in between my files and your sample data's format.

First, I would like to answer your questions. 1) The sample size is 442, 2) The data modality is: z-scored rs-fMRI connectivity matrices (Schaefer 1000).

Second, I believe that this issue can be closed as I have made adjustments to my files and the error no longer occurs. I did so by realizing that the design matrix needs two columns that work antagonistically with each other (essentially a contrast needs to occur). Therefore, I created two columns: one with an indication for diagnosis positives and one with an indication for control positives. Maybe it would be good to clear that up in the manual, specifically that one has to have two columns that contrast each other as originally I just had two identical diagnosis positive columns.

Thank you for your time!

eminSerin commented 1 year ago

It's great that your issue has been solved. Good luck with your analyses!