Skip to content

Commit

Permalink
write correlation to correlation.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
valenzuelaomar committed Aug 29, 2023
1 parent 140461d commit 93e3039
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,12 @@
"if ref_data: \n",
" correlations = joined[joined[\"max_rPM\"] >= min_rPM].fillna(0)\n",
" res = scipy.stats.spearmanr(correlations[\"max_rPM\"], correlations[\"max_rPM.REF\"])\n",
" correlation = round(res.correlation, 2)\n",
" with open(\"correlation.txt\", \"w\") as f:\n",
" f.write(str(correlation))\n",
"\n",
" fig, ax = plt.subplots(1, 2, figsize=(12,6))\n",
" fig.suptitle(f\"Correlation plots: Spearman's R {round(res.correlation, 2)}\")\n",
" fig.suptitle(f\"Correlation plots: Spearman's R {correlation}\")\n",
" sns.scatterplot(ax=ax[0], data=correlations, x=\"max_rPM\", y=\"max_rPM.REF\")\n",
" ax[0].set_title(\"Raw scatterplot\")\n",
"\n",
Expand Down

0 comments on commit 93e3039

Please sign in to comment.