gregversteeg / bio_corex

A flexible version of CorEx developed for bio-data challenges that handles missing data, continuous/discrete variables, multi-CPU, overlapping structure, and includes visualizations
Apache License 2.0
137 stars 30 forks source link

zero total correlation for biocorex applied on diffusion MRI data #32

Open rosella1234 opened 2 months ago

rosella1234 commented 2 months ago

I have tried to apply biocorex con a 14 by 2286 matrix for each subject. Every row is a flattened diffusion MRI measure, and I want to inspect hidden relationships among each of these 14 diffusion MRI measure. The code I use is the following:

# Set bioCorEx parameters
num_hidden_factors = 10
dim_hidden_factor = 1
marginal_description = 'gaussian'
smooth_marginals = True
# Initialize an empty NumPy array to store the output
output_matrix = np.empty((num_subjects, num_hidden_factors))
for i in range(1, num_subjects):
    # Initialize bioCorEx object
    corex = ce.Corex(n_hidden=num_hidden_factors, dim_hidden=dim_hidden_factor, marginal_description =marginal_description, smooth_marginals=smooth_marginals)
    # Fit bioCorEx model
    corex.fit(data_matrix[i,:,:])
    print(corex.tcs)
    print(corex.clusters)
    output_matrix[i, :] = corex.tcs
np.save('output_matrix.npy', output_matrix)

However, total correlations array is made of 0 for each hidden factor and for all subjects. Do you have any idea what I am doing wrong? thanks in advance Rosella