(feature_columns, prefix='')
| 126 | |
| 127 | |
| 128 | def build_input_features(feature_columns, prefix=''): |
| 129 | input_features = OrderedDict() |
| 130 | for fc in feature_columns: |
| 131 | if isinstance(fc, SparseFeat): |
| 132 | input_features[fc.name] = Input( |
| 133 | shape=(1,), name=prefix + fc.name, dtype=fc.dtype) |
| 134 | elif isinstance(fc, DenseFeat): |
| 135 | input_features[fc.name] = Input( |
| 136 | shape=(fc.dimension,), name=prefix + fc.name, dtype=fc.dtype) |
| 137 | elif isinstance(fc, VarLenSparseFeat): |
| 138 | input_features[fc.name] = Input(shape=(fc.maxlen,), name=prefix + fc.name, |
| 139 | dtype=fc.dtype) |
| 140 | if fc.weight_name is not None: |
| 141 | input_features[fc.weight_name] = Input(shape=(fc.maxlen, 1), name=prefix + fc.weight_name, |
| 142 | dtype="float32") |
| 143 | if fc.length_name is not None: |
| 144 | input_features[fc.length_name] = Input((1,), name=prefix + fc.length_name, dtype='int32') |
| 145 | |
| 146 | else: |
| 147 | raise TypeError("Invalid feature column type,got", type(fc)) |
| 148 | |
| 149 | return input_features |
| 150 | |
| 151 | |
| 152 | def get_linear_logit(features, feature_columns, units=1, use_bias=False, seed=1024, prefix='linear', |
no outgoing calls
no test coverage detected