McIntosh-Lab / plspy

Implementation of Partial Least Squares in Python
Other
4 stars 1 forks source link

Discrepancies between plsrri and MATLAB PLS results #2

Open philjohnston opened 3 years ago

philjohnston commented 3 years ago

After running mean-centred PLS on the attached files, there are several discrepancies between the plsrri and MATLAB results:

  1. Permutation ratios are different
  2. The plsrri bootstrap ratios are very small with plsrri (e.g. mean of 2x10^-2 for the first LV for patients)
  3. The salience values for the second LV are different between the two versions (but they're the same for the first LV).
  4. U and V matrices are swapped between versions?

Note that the singular values (S) are the same in both versions.

exp_mats.zip

Reproducing code example:

Python syntax:

import plsrri

# Import data
patient_exps = np.loadtxt("patient_exps_mat.csv", delimiter=",")
control_exps = np.loadtxt("control_exps_mat.csv", delimiter=",")

# Run PLS
patient_result = plsrri.PLS(np.array(patient_exps), [17], num_conditions=2, num_groups=1, num_perm = 1000, num_boot = 1000, pls_method="mct")
control_result = plsrri.PLS(np.array(control_exps), [23], num_conditions=2, num_groups=1, num_perm = 1000, num_boot = 1000, pls_method="mct")

Matlab syntax:


% Load data
patient_exps = csvread('patient_exps_mat.csv');
control_exps = csvread('control_exps_mat.csv');

% PLS options
option.num_perm = 1000
option.num_boot = 1000
option.method = 1

% Run PLS

patient_result = pls_analysis({patient_exps}, [17], 2, option)
control_result = pls_analysis({control_exps}, [23], 2, option)

plsrri/Python version information:

plsrri: AttributeError: module 'plsrri' has no attribute 'version' ?

Python: 3.8.6 | packaged by conda-forge | (default, Dec 26 2020, 05:05:16) [GCC 9.3.0]

pmahon3 commented 9 months ago

Hey @philjohnston I'm starting to get into this. Do you know where I can find the data referenced here?

patient_exps = np.loadtxt("patient_exps_mat.csv", delimiter=",")
control_exps = np.loadtxt("control_exps_mat.csv", delimiter=",")
pmahon3 commented 9 months ago

Hey @philjohnston I'm starting to get into this. Do you know where I can find the data referenced here?

patient_exps = np.loadtxt("patient_exps_mat.csv", delimiter=",")
control_exps = np.loadtxt("control_exps_mat.csv", delimiter=",")

Nvm I see them in the exp_mats.zip!

philjohnston commented 9 months ago

Ok nice, let me know if you need anything else!


From: Patrick Mahon @.> Sent: November 16, 2023 4:48 PM To: McIntosh-Lab/plspy @.> Cc: Phil Johnston @.>; Mention @.> Subject: Re: [McIntosh-Lab/plspy] Discrepancies between plsrri and MATLAB PLS results (#2)

Hey @philjohnstonhttps://github.com/philjohnston I'm starting to get into this. Do you know where I can find the data referenced here?

patient_exps = np.loadtxt("patient_exps_mat.csv", delimiter=",") control_exps = np.loadtxt("control_exps_mat.csv", delimiter=",")

Nvm I see them in the exp_mats.zip!

— Reply to this email directly, view it on GitHubhttps://github.com/McIntosh-Lab/plspy/issues/2#issuecomment-1815367728, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKIG77ROIDDX7QSJ4J767XDYE2C3NAVCNFSM4WZFVFR2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGUZTMNZXGI4A. You are receiving this because you were mentioned.Message ID: @.***>