Ejemplo n.º 1
0
def recommender_model_to_dict(model_model):
    dict_form = dump_model(model_model)
    dict_form["model"] = dict_form["model_id"]
    del dict_form["model_id"]
    dict_form["default-recommendations"] = dict_form["default_n"]
    del dict_form["default_n"]
    return dict_form
Ejemplo n.º 2
0
def model_model_to_dict(model_model):
    dict_form = dump_model(model_model)
    del dict_form["type_id"]
    dict_form["datasource"] = dict_form["datasource_id"]
    del dict_form["datasource_id"]
    dict_form["type"] = model_model.type.name
    dict_form["input-columns"] = {
        column_pair.model_column: column_pair.datasource_column
        for column_pair in model_model.input_columns
    }
    return dict_form
Ejemplo n.º 3
0
def datasource_model_to_dict(datasource_model):
    dict_form = dump_model(datasource_model)
    dict_form["column-names"] = [
        column.name for column in datasource_model.column_names
    ]
    return dict_form