Skip to content

Commit

Permalink
fix minor bug while creating the plot
Browse files Browse the repository at this point in the history
  • Loading branch information
deven367 committed May 31, 2024
1 parent 45f1298 commit a3a3a64
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
16 changes: 9 additions & 7 deletions clean_plot/heatmaps_novels.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def heatmap_from_pkl(
]
sm_labels = ["DC", "I-F", "DB", "RB", "USE", "MPNet", "XLM", "MiniLM"]

df2 = df[organized_labels]
# df2 = df[organized_labels]
df2 = pd.DataFrame(norm, columns=df.columns)
df2 = df2[organized_labels]


if min_labels:
df2.columns = sm_labels
Expand Down Expand Up @@ -276,10 +279,10 @@ def plot_histograms(
files = loader(path, ".npy")
curr = Path.cwd()
if std:
new_path = curr / f"histogram_std"
new_path = curr / "histogram_std"
new_path.mkdir(exist_ok=True)
else:
new_path = curr / f"histogram"
new_path = curr / "histogram"
new_path.mkdir(exist_ok=True)

for f in files:
Expand Down Expand Up @@ -401,7 +404,7 @@ def corr_heatmaps(
files = loader(path, ".npy")
curr = Path.cwd()

new_path = curr / f"corr_ssm"
new_path = curr / "corr_ssm"
new_path.mkdir(exist_ok=True)

d = {}
Expand Down Expand Up @@ -486,10 +489,9 @@ def corr_ts(
files = loader(path, ".pkl")
curr = Path.cwd()

new_path = curr / f"corr_ts"
new_path = curr / "corr_ts"
new_path.mkdir(exist_ok=True)

d = {}
for f in files:
fname = f.stem.split("_cleaned_")
fname = open(f, "rb")
Expand All @@ -505,7 +507,7 @@ def lex_ts(
"Generate lexical TS from Lexical SSM"

files = loader(path, "wt_ssm.npy")
curr = Path.cwd()
Path.cwd()

for f in files:
em = np.load(f)
Expand Down
16 changes: 9 additions & 7 deletions nbs/03_heatmaps_novels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@
" ]\n",
" sm_labels = [\"DC\", \"I-F\", \"DB\", \"RB\", \"USE\", \"MPNet\", \"XLM\", \"MiniLM\"]\n",
"\n",
" df2 = df[organized_labels]\n",
" # df2 = df[organized_labels]\n",
" df2 = pd.DataFrame(norm, columns=df.columns)\n",
" df2 = df2[organized_labels]\n",
"\n",
"\n",
" if min_labels:\n",
" df2.columns = sm_labels\n",
Expand Down Expand Up @@ -450,10 +453,10 @@
" files = loader(path, \".npy\")\n",
" curr = Path.cwd()\n",
" if std:\n",
" new_path = curr / f\"histogram_std\"\n",
" new_path = curr / \"histogram_std\"\n",
" new_path.mkdir(exist_ok=True)\n",
" else:\n",
" new_path = curr / f\"histogram\"\n",
" new_path = curr / \"histogram\"\n",
" new_path.mkdir(exist_ok=True)\n",
"\n",
" for f in files:\n",
Expand Down Expand Up @@ -597,7 +600,7 @@
" files = loader(path, \".npy\")\n",
" curr = Path.cwd()\n",
"\n",
" new_path = curr / f\"corr_ssm\"\n",
" new_path = curr / \"corr_ssm\"\n",
" new_path.mkdir(exist_ok=True)\n",
"\n",
" d = {}\n",
Expand Down Expand Up @@ -689,10 +692,9 @@
" files = loader(path, \".pkl\")\n",
" curr = Path.cwd()\n",
"\n",
" new_path = curr / f\"corr_ts\"\n",
" new_path = curr / \"corr_ts\"\n",
" new_path.mkdir(exist_ok=True)\n",
"\n",
" d = {}\n",
" for f in files:\n",
" fname = f.stem.split(\"_cleaned_\")\n",
" fname = open(f, \"rb\")\n",
Expand All @@ -715,7 +717,7 @@
" \"Generate lexical TS from Lexical SSM\"\n",
"\n",
" files = loader(path, \"wt_ssm.npy\")\n",
" curr = Path.cwd()\n",
" Path.cwd()\n",
"\n",
" for f in files:\n",
" em = np.load(f)\n",
Expand Down

0 comments on commit a3a3a64

Please sign in to comment.