diff --git a/tools/ludwig_autogencofig.py b/tools/ludwig_autogencofig.py new file mode 100644 index 0000000..8f9d7f7 --- /dev/null +++ b/tools/ludwig_autogencofig.py @@ -0,0 +1,25 @@ +import argparse + +import logging + +from ludwig import automl +from ludwig.utils import defaults + +logging.basicConfig(level=logging.DEBUG) +LOG = logging.getLogger(__name__) + +def main(): + parser = argparse.ArgumentParser(description='Render a Ludwig config') + parser.add_argument('--dataset', type=str, help='Path to the dataset file', required=True) + parser.add_argument('--output_feature', type=str, help='Name for the output feature', required=True) + parser.add_argument('--output', type=str, help='Path for the output file', required=True) + args = parser.parse_args() + + + args_init = ["--dataset", args.dataset, "--target", args.output_feature, "--output", args.output] + automl.cli_init_config(args_init) + args_render = ["--config", args.output, "--output", args.output] + defaults.cli_render_config(args_render) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tools/ludwig_autogencofig.xml b/tools/ludwig_autogencofig.xml new file mode 100644 index 0000000..83da665 --- /dev/null +++ b/tools/ludwig_autogencofig.xml @@ -0,0 +1,41 @@ + + Auto-generate a config file from a dataset for Ludwig training. + + ludwig_macros.xml + + + + echo "@VERSION@" + + + + + + + + + + + + + + + + + + + + + + +