3e2f276459f976054b5c2ab8c55be994170345da,ludwig/utils/defaults.py,,merge_with_defaults,#Any#,169

Before Change


    stratify = model_definition["preprocessing"]["stratify"]

    if stratify is not None:
        if stratify not in [x["name"] for x in
                            model_definition["output_features"]]:
            raise ValueError("Stratify must be in output features")
        if ([x for x in model_definition["output_features"] if
             x["name"] == stratify][0][TYPE]
                not in [BINARY, CATEGORY]):
            raise ValueError("Stratify feature must be binary or category")

After Change


                model_definition["input_features"] +
                model_definition["output_features"]
        )
        feature_names = set(f["name"] for f in features)
        if stratify not in feature_names:
            logger.warning(
                "Stratify is not among the features. "
                "Cannot establish if it is a binary or category"
            )
        elif ([f for f in features if f["name"] == stratify][0][TYPE]
              not in {BINARY, CATEGORY}):
            raise ValueError("Stratify feature must be binary or category")

    // ===== Training =====
    set_default_value(model_definition, TRAINING, default_training_params)

    for param, value in default_training_params.items():
        set_default_value(model_definition[TRAINING], param,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: uber/ludwig
Commit Name: 3e2f276459f976054b5c2ab8c55be994170345da
Time: 2020-08-27
Author: carlo.grisetti@dsgroup.it
File Name: ludwig/utils/defaults.py
Class Name:
Method Name: merge_with_defaults


Project Name: snipsco/snips-nlu
Commit Name: c31afbb3c7523e111bb13f16afb2cb98d3ffe424
Time: 2018-06-15
Author: adrien.ball@snips.net
File Name: snips_nlu/resources.py
Class Name:
Method Name: load_resources


Project Name: scikit-learn/scikit-learn
Commit Name: fcc2624ae4d70e050424b7786775e39c81357aa6
Time: 2019-09-09
Author: martinagonzalezvilas@gmail.com
File Name: sklearn/dummy.py
Class Name: DummyClassifier
Method Name: fit