def sum_coding(X_in, cols=None):

    X = copy.deepcopy(X_in)

    if cols is None:
        cols = X.columns.values
        pass_thru = []
    else:
        pass_thru = [col for col in X.columns.values if col not in cols]

    bin_cols = []
    for col in cols:
        mod = dmatrix("C(%s, Sum)" % (col, ), X)
        for dig in range(len(mod[0])):
            X[col + '_%d' % (dig, )] = mod[:, dig]
            bin_cols.append(col + '_%d' % (dig, ))

    X = X.reindex(columns=bin_cols + pass_thru)

    return X
Fetch the specified Solr search index for Yokozuna.
dataset/ETHPy150Open wdm0006/categorical_encoding/category_encoders/sum_coding.py/sum_coding--crossover with--dataset/ETHPy150Open basho/riak-python-client/riak/transports/http/transport.py/HttpTransport.delete_search_index