Newshot
Account

Michelangelo AI

Original text(via HN AI)

Simple, powerful API

From training to production in minutes


        1import michelangelo.uniflow.core as uniflow2from michelangelo.uniflow.plugins.ray import RayTask3
[email protected](config=RayTask(head_cpu=2, worker_instances=2))5def train(train_data, validation_data, params: dict):6    """Distributed training with Ray."""7    trainer = XGBoostTrainer(8        params=params,9        datasets={"train": train_data, "validation": validation_data},10    )11    return trainer.fit()12
[email protected]()14def train_workflow(dataset: str):15    """End-to-end ML training pipeline."""16    train_data, val_data = load_and_split(dataset)17    result = train(train_data, val_data, params={"max_depth": 5})18    return result19
20if __name__ == "__main__":21    ctx = uniflow.create_context()22    ctx.run(train_workflow, dataset="s3://data/training.parquet")
      

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by HN AI
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗