Sonja Topf
big refactoring
e517ec0
raw
history blame contribute delete
705 Bytes
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)