Perturbation-Response-Prediction / PRnet

PRnet is a flexible and scalable perturbation-conditioned generative model predicting transcriptional responses to unseen complex perturbations at bulk and single-cell levels.
Apache License 2.0
23 stars 3 forks source link

about r2_mean issue #2

Closed younng367 closed 1 day ago

younng367 commented 1 month ago

guys you have to add the two function by manual .which in the data fold. r2_mean and pearson_mean

Jianbo1999 commented 1 month ago

can you say more details? Please

Jianbo1999 commented 1 month ago

I added this codes in line 510, it work.

def pearson_mean(data1, data2): sum_pearson_1 = 0 sum_pearson2 = 0 for i in range(data1.shape[0]): pearsonr = pearsonr(data1[i], data2[i]) sum_pearson1 += pearsonr[0] sum_pearson2 += pearsonr[1] return sum_pearson_1/data1.shape[0], sum_pearson_2/data1.shape[0]

def r2_mean(data1, data2): sum_r2_1 = 0 for i in range(data1.shape[0]): r2score = r2_score(data1[i], data2[i]) sum_r2_1 += r2score
return sum_r2_1/data1.shape[0]

nicole1q commented 1 month ago

We have recently updated the GitHub repository to address some missing functions in the code. Please pull the latest version, which should resolve these issues.