Spaces:
Sleeping
Sleeping
File size: 705 Bytes
e517ec0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import subprocess
from datetime import datetime
def train_model(data_path: str, config_path: str, save_model_path: str):
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
command = [
"chemprop", "train",
"--data-path", data_path,
"--config-path", config_path,
"--splits-column", "split",
"--logfile", save_model_path + f"/train_{timestamp}.log",
"--task-type", "classification",
"--target-columns", "NR-AhR","NR-AR","NR-AR-LBD","NR-Aromatase","NR-ER","NR-ER-LBD","NR-PPAR-gamma","SR-ARE","SR-ATAD5","SR-HSE","SR-MMP","SR-p53",
"--save-dir", save_model_path
]
# Run the command
subprocess.run(command, check=True) |