a871536bcbb38b9ca03b0bc777712d8c0a79ad90,matchzoo/data_pack/pack.py,,pack,#Any#,17

Before Change


    :return: User input into a :class:`DataPack` with left, right and
        relation..
    
    col_all = ["id_left", "id_right", "text_left", "text_right"]
    col_relation = ["id_left", "id_right"]

    if _has_label(data):
        col_relation.append("label")
        col_all.append("label")

    // prepare data pack.
    df = pd.DataFrame(data, columns=col_all)
    df.fillna("missing")  // avoid tokenization exception.

    // Segment input into 3 dataframes.
    relation = df[col_relation]

    left = df[["id_left", "text_left"]].drop_duplicates(["id_left"])
    left.set_index("id_left", inplace=True)
    // Infer the length of the text left
    // left["length_left"] = left.apply(lambda r: len(r["text_left"]), axis=1)

After Change


        id_right = df["id_right"]

    // Build Relation
    relation = pd.DataFrame(data={"id_left": id_left, "id_right": id_right})
    for col in df:
        if col not in ["id_left", "id_right", "text_left", "text_right"]:
            relation[col] = df[col]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: NTMC-Community/MatchZoo
Commit Name: a871536bcbb38b9ca03b0bc777712d8c0a79ad90
Time: 2018-12-13
Author: i@uduse.com
File Name: matchzoo/data_pack/pack.py
Class Name:
Method Name: pack


Project Name: NTMC-Community/MatchZoo
Commit Name: a871536bcbb38b9ca03b0bc777712d8c0a79ad90
Time: 2018-12-13
Author: i@uduse.com
File Name: matchzoo/data_pack/pack.py
Class Name:
Method Name: pack


Project Name: ClimbsRocks/auto_ml
Commit Name: e36759520ea3342600180aa2818b4b9b8be9de00
Time: 2017-05-21
Author: climbsbytes@gmail.com
File Name: auto_ml/predictor.py
Class Name: Predictor
Method Name: _print_ml_analytics_results_linear_model


Project Name: ClimbsRocks/auto_ml
Commit Name: e6bc2e29b7825e15f4e0e95d74e43910d69875cc
Time: 2017-05-20
Author: climbsbytes@gmail.com
File Name: auto_ml/predictor.py
Class Name: Predictor
Method Name: _get_xgb_feat_importances