INNER CODE UNIT · Python

cmd_gen_data

initial-d/ml-quant-trading · src/mlquant/cli/main.py:224

def cmd_gen_data(config_path: str) -> None:
    cfg = load_config(config_path)
    seed_everything(cfg.get("seed", 42))
    syn = SyntheticConfig(**cfg.synthetic.to_dict()) if "synthetic" in cfg else SyntheticConfig()
    panel = make_synthetic_panel(syn)
    out = _artifacts_dir(cfg) / "panel.pt"
    blob = {"dates": panel.dates, "stocks": panel.stocks}
    for key in _PANEL_FIELDS + _OPTIONAL_PANEL_FIELDS:
        blob[key] = getattr(panel, key)
    torch.save(blob, out)
    click.echo(f"wrote {out}  ({panel.n_dates} dates × {panel.n_stocks} stocks)")


@cli.command("features")
@click.option("--config", "config_path", required=True, type=click.Path(exists=True))
def cmd_features(config_path: str) -> None:
    cfg = load_config(config_path)
    seed_everything(cfg.get("seed", 42))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…