val_dfs = np.array_split(val_df, 3)
print("##########chunking done##########")
# %% directories
table_dirs = [join("tables", val) for val in ["val1", "val2", "val3"]]
figure_dirs = [join("figures", val) for val in ["val1", "val2", "val3"]]
# %% fit, predict, plot
disc.fit(train_df)
print("##########fitting done##########")
for i, val_df in enumerate(val_dfs):
# change output dirs
disc.table_dir = table_dirs[i]
disc.figure_dir = figure_dirs[i]
# %% predict
score = disc.predict(val_df, umap_random_state=42)
print("##########predictions done##########")
# %% plot and save
disc.plot()
FileNotFoundError Traceback (most recent call last)
<ipython-input-32-7f8d2c805a2e> in <module>()
16
17 # %% plot and save
---> 18 disc.plot()
19 disc.save(dummy=dummy)
20
7 frames
/usr/local/lib/python3.7/dist-packages/mat_discover/mat_discover_.py in plot(self, return_pareto_ind)
1318 Pareto front indices for the peak and density proxies, respectively.
1319 """
-> 1320 fig, pk_pareto_ind = self.pf_peak_proxy()
1321 fig, frac_pareto_ind = self.pf_train_contrib_proxy()
1322
/usr/local/lib/python3.7/dist-packages/mat_discover/mat_discover_.py in pf_peak_proxy(self)
1544 x_unit=self.target_unit,
1545 y_unit=self.target_unit,
-> 1546 use_plotly_offline=self.use_plotly_offline,
1547 )
1548
/usr/local/lib/python3.7/dist-packages/mat_discover/utils/pareto.py in pareto_plot(df, x, y, color, x_unit, y_unit, color_unit, hover_data, fpath, reverse_x, parity_type, pareto_front, color_continuous_scale, color_discrete_map, xrange, use_plotly_offline)
214
215 if fpath is not None:
--> 216 fig.write_html(fpath + ".html")
217
218 fig, scale = matplotlibify(fig)
/usr/local/lib/python3.7/dist-packages/plotly/basedatatypes.py in write_html(self, *args, **kwargs)
3706 import plotly.io as pio
3707
-> 3708 return pio.write_html(self, *args, **kwargs)
3709
3710 def to_image(self, *args, **kwargs):
/usr/local/lib/python3.7/dist-packages/plotly/io/_html.py in write_html(fig, file, config, auto_play, include_plotlyjs, include_mathjax, post_script, full_html, animation_opts, validate, default_width, default_height, auto_open, div_id)
534 # Write HTML string
535 if path is not None:
--> 536 path.write_text(html_str)
537 else:
538 file.write(html_str)
/usr/lib/python3.7/pathlib.py in write_text(self, data, encoding, errors)
1238 raise TypeError('data must be str, not %s' %
1239 data.__class__.__name__)
-> 1240 with self.open(mode='w', encoding=encoding, errors=errors) as f:
1241 return f.write(data)
1242
/usr/lib/python3.7/pathlib.py in open(self, mode, buffering, encoding, errors, newline)
1206 self._raise_closed()
1207 return io.open(self, mode, buffering, encoding, errors, newline,
-> 1208 opener=self._opener)
1209
1210 def read_bytes(self):
/usr/lib/python3.7/pathlib.py in _opener(self, name, flags, mode)
1061 def _opener(self, name, flags, mode=0o666):
1062 # A stub for the opener argument to built-in open()
-> 1063 return self._accessor.open(self, flags, mode)
1064
1065 def _raw_open(self, flags, mode=0o777):
FileNotFoundError: [Errno 2] No such file or directory: 'figures/val1/pf-peak-proxy.html
I know it's something to do with the directory I created, I just need plot to recognize all 3 chunks