Mercurial > repos > goeckslab > ludwig_experiment
annotate ludwig_hyperopt.py @ 0:78e6686a218e draft
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
| author | goeckslab | 
|---|---|
| date | Tue, 07 Jan 2025 22:45:39 +0000 | 
| parents | |
| children | 78b1e3921576 | 
| rev | line source | 
|---|---|
| 
0
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
1 import logging | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
2 import os | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
3 import pickle | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
4 import sys | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
5 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
6 from ludwig.globals import ( | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
7 HYPEROPT_STATISTICS_FILE_NAME, | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
8 ) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
9 from ludwig.hyperopt_cli import cli | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
10 from ludwig.visualize import get_visualizations_registry | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
11 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
12 from model_unpickler import SafeUnpickler | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
13 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
14 from utils import ( | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
15 encode_image_to_base64, | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
16 get_html_closing, | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
17 get_html_template | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
18 ) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
19 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
20 logging.basicConfig(level=logging.DEBUG) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
21 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
22 LOG = logging.getLogger(__name__) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
23 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
24 setattr(pickle, 'Unpickler', SafeUnpickler) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
25 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
26 cli(sys.argv[1:]) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
27 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
28 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
29 def generate_html_report(title): | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
30 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
31 # Read test statistics JSON and convert to HTML table | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
32 # try: | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
33 # test_statistics_path = hyperopt_stats_path | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
34 # with open(test_statistics_path, "r") as f: | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
35 # test_statistics = json.load(f) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
36 # test_statistics_html = "<h2>Hyperopt Statistics</h2>" | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
37 # test_statistics_html += json_to_html_table(test_statistics) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
38 # except Exception as e: | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
39 # LOG.info(f"Error reading hyperopt statistics: {e}") | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
40 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
41 plots_html = "" | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
42 # Convert visualizations to HTML | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
43 hyperopt_hiplot_path = os.path.join( | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
44 viz_output_directory, "hyperopt_hiplot.html") | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
45 if os.path.isfile(hyperopt_hiplot_path): | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
46 with open(hyperopt_hiplot_path, "r", encoding="utf-8") as file: | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
47 hyperopt_hiplot_html = file.read() | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
48 plots_html += f'<div class="hiplot">{hyperopt_hiplot_html}</div>' | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
49 plots_html += "uid is the identifier for different hyperopt runs" | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
50 plots_html += "<br><br>" | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
51 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
52 # Iterate through other files in viz_output_directory | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
53 for plot_file in sorted(os.listdir(viz_output_directory)): | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
54 plot_path = os.path.join(viz_output_directory, plot_file) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
55 if os.path.isfile(plot_path) and plot_file.endswith((".png", ".jpg")): | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
56 encoded_image = encode_image_to_base64(plot_path) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
57 plots_html += ( | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
58 f'<div class="plot">' | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
59 f'<h3>{os.path.splitext(plot_file)[0]}</h3>' | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
60 '<img src="data:image/png;base64,' | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
61 f'{encoded_image}" alt="{plot_file}">' | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
62 f'</div>' | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
63 ) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
64 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
65 # Generate the full HTML content | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
66 html_content = f""" | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
67 {get_html_template()} | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
68 <h1>{title}</h1> | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
69 <h2>Visualizations</h2> | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
70 {plots_html} | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
71 {get_html_closing()} | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
72 """ | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
73 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
74 # Save the HTML report | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
75 report_name = title.lower().replace(" ", "_") | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
76 report_path = os.path.join(output_directory, f"{report_name}_report.html") | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
77 with open(report_path, "w") as report_file: | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
78 report_file.write(html_content) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
79 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
80 LOG.info(f"HTML report generated at: {report_path}") | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
81 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
82 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
83 # visualization | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
84 output_directory = None | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
85 for ix, arg in enumerate(sys.argv): | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
86 if arg == "--output_directory": | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
87 output_directory = sys.argv[ix+1] | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
88 break | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
89 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
90 hyperopt_stats_path = os.path.join( | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
91 output_directory, | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
92 "hyperopt", HYPEROPT_STATISTICS_FILE_NAME | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
93 ) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
94 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
95 visualizations = ["hyperopt_report", "hyperopt_hiplot"] | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
96 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
97 viz_output_directory = os.path.join(output_directory, "visualizations") | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
98 for viz in visualizations: | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
99 viz_func = get_visualizations_registry()[viz] | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
100 viz_func( | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
101 hyperopt_stats_path=hyperopt_stats_path, | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
102 output_directory=viz_output_directory, | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
103 file_format="png", | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
104 ) | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
105 | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
106 # report | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
107 title = "Ludwig Hyperopt" | 
| 
 
78e6686a218e
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
108 generate_html_report(title) | 
