ludwig-ai--ludwig
593b94c120
pytest / Unit Tests (push) Has been cancelled
pytest / Integration (integration_tests_a) (push) Has been cancelled
pytest / Integration (integration_tests_b) (push) Has been cancelled
pytest / Integration (integration_tests_c) (push) Has been cancelled
pytest / Integration (integration_tests_d) (push) Has been cancelled
pytest / Integration (integration_tests_e) (push) Has been cancelled
pytest / Integration (integration_tests_f) (push) Has been cancelled
pytest / Integration (integration_tests_g) (push) Has been cancelled
pytest / Integration (integration_tests_h) (push) Has been cancelled
pytest / Integration (integration_tests_i) (push) Has been cancelled
pytest / Integration (integration_tests_j) (push) Has been cancelled
pytest / Distributed (distributed_a) (push) Has been cancelled
pytest / Distributed (distributed_b) (push) Has been cancelled
pytest / Distributed (distributed_c) (push) Has been cancelled
pytest / Distributed (distributed_d) (push) Has been cancelled
pytest / Distributed (distributed_e) (push) Has been cancelled
pytest / Distributed (distributed_f) (push) Has been cancelled
pytest / Minimal Install (push) Has been cancelled
pytest / Event File (push) Has been cancelled
pytest (slow) / py-slow (push) Has been cancelled
Publish JSON Schema / publish-schema (push) Has been cancelled
27 行
559 B
Python
27 行
559 B
Python
"""Train a model from entirely synthetic data."""
|
|
|
|
import logging
|
|
import tempfile
|
|
|
|
import yaml
|
|
|
|
from ludwig.api import LudwigModel
|
|
from ludwig.data.dataset_synthesizer import build_synthetic_dataset_df
|
|
|
|
config = yaml.safe_load("""
|
|
input_features:
|
|
- name: Pclass (new)
|
|
type: category
|
|
|
|
output_features:
|
|
- name: Survived
|
|
type: binary
|
|
|
|
""")
|
|
|
|
df = build_synthetic_dataset_df(120, config)
|
|
model = LudwigModel(config, logging_level=logging.INFO)
|
|
|
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
model.train(dataset=df, output_directory=tmpdir)
|