在Colab中使用路德维希(Ludwig)尝试弄清楚如何内联创建model_definition.yaml文件以用于构建模型

时间:2019-03-15 02:05:50

标签: google-colaboratory

因此,文档提供了需要使用model_definition.yaml文件来训练和测试Uber在路德维希中的模型。我正在尝试在自定义数据集上使用它,我的CSV文件也已作为数据框读入熊猫。我试图创建一个model_definition

我一直在尝试从路德维希乡亲的github响应中使用这种方法:

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)

有关如何创建model_definitions的文档需要更加详细。

错误是语法错误。

2 个答案:

答案 0 :(得分:0)

这没有语法错误

dict = {'input_features': [{'name': 'Open_Price', 'type': 'numerical'}], 'output_features': [{'name': 'Closing_Price', 'type': 'numerical'}]}
model_definition = dict 
ludwig_model = LudwigModel(model_definition)

答案 1 :(得分:0)

您最好引用字典中的值。