Mercurial > repos > goeckslab > ludwig_train
annotate ludwig_train.py @ 2:3f587f0e5a6d draft
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit 008bc5a8ee2c80f70fc224a23b5d2cd0c8ef1810
| author | goeckslab | 
|---|---|
| date | Fri, 14 Mar 2025 16:49:34 +0000 | 
| parents | f0be10937f5c | 
| children | 650639a4a75f | 
| rev | line source | 
|---|---|
| 
0
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
1 import logging | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
2 import pickle | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
3 import sys | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
4 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
5 from ludwig.train import cli | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
6 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
7 from ludwig_experiment import ( | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
8 convert_parquet_to_csv, | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
9 generate_html_report, | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
10 make_visualizations | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
11 ) | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
12 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
13 from model_unpickler import SafeUnpickler | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
14 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
15 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
16 logging.basicConfig(level=logging.DEBUG) | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
17 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
18 setattr(pickle, 'Unpickler', SafeUnpickler) | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
19 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
20 cli(sys.argv[1:]) | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
21 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
22 ludwig_output_directory_name = "experiment_run" | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
23 | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
24 make_visualizations(ludwig_output_directory_name) | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
25 convert_parquet_to_csv( | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
26 ludwig_output_directory_name | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
27 ) | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
28 title = "Ludwig Train" | 
| 
 
f0be10937f5c
planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit bdea9430787658783a51cc6c2ae951a01e455bb4
 
goeckslab 
parents:  
diff
changeset
 | 
29 generate_html_report(title, ludwig_output_directory_name) | 
