0

So the documentation provides that a model_definition.yaml file is required to train and test models in ludwig by Uber. I'm trying to use it on a custom dataset which I have a CSV file that was read into pandas as a dataframe as well. I tried to create a model_definition

I have been attempting to use this approach from github responses by ludwig folks:

import yaml

model_definition = {}
model_definition['input_features'] = [{'name': acoustic_data, type: category}, {'name': time_to_failure, type: numerical}]
model_definition['output_features'] = [{'name': time_to_failure.train.csv, 'type': numerical,loss:mean_absolute_error}]
model_definition['training'] = {}
ludwig_model = LudwigModel(model_definition)
train_stats = ludwig_model.train(data_df=LANL_data)

the documentation for how to create model_definitions needs to be more detailed.

Error is Syntax Error.

Richard Chambers
  • 16,643
  • 4
  • 81
  • 106
konsama
  • 327
  • 2
  • 12

2 Answers2

0

This gave me no syntax error

dict = {'input_features': [{'name': 'Open_Price', 'type': 'numerical'}], 'output_features': [{'name': 'Closing_Price', 'type': 'numerical'}]}
model_definition = dict 
ludwig_model = LudwigModel(model_definition)
Rhasz
  • 11
  • 1
  • 5
0

you better quote the values in the dictionaries.

LisboaFJG
  • 21
  • 3