def map_coefficients(self):
        """ Maps each field to the corresponding coefficients subarray

        """
        field_ids = [ \
            field_id for field_id, _ in
            sorted(self.fields.items(),
                   key=lambda x: x[1].get("column_number"))
            if field_id != self.objective_id]
        shift = 0
        for field_id in field_ids:
            optype = self.fields[field_id]['optype']
            if optype in EXPANSION_ATTRIBUTES.keys():
                # text, items and categorical fields have one coefficient per
                # text/class plus a missing terms coefficient plus a bias
                # coefficient
                length = len(self.fields[field_id]['summary'][ \
                    EXPANSION_ATTRIBUTES[optype]])
                # missing coefficient
                length += 1
            else:
                # numeric fields have one coefficient and an additional one
                # if self.missing_numerics is True
                length = 2 if self.missing_numerics else 1
            self.fields[field_id]['coefficients_shift'] = shift
            shift += length
dataset/ETHPy150Open bigmlcom/python/bigml/logistic.py/LogisticRegression.map_coefficients/original