mirror of
https://github.com/twitter/the-algorithm.git
synced 2025-01-07 01:48:16 +01:00
Merge d2da7e56ab
into 72eda9a24f
This commit is contained in:
commit
b4f0518ee5
@ -51,12 +51,13 @@ class TFModelInitializerBuilder:
|
|||||||
if len(discretized_features) == 0:
|
if len(discretized_features) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
num_bins = max([len(bins) for bins in discretized_features.values()])
|
num_bins = max(len(bins) for bins in discretized_features.values())
|
||||||
|
|
||||||
bin_boundaries_and_weights = {}
|
bin_boundaries_and_weights = {
|
||||||
for feature_name in discretized_features:
|
feature_name: self._extract_bin_boundaries_and_weights(
|
||||||
bin_boundaries_and_weights[feature_name] = self._extract_bin_boundaries_and_weights(
|
|
||||||
discretized_features[feature_name], num_bins)
|
discretized_features[feature_name], num_bins)
|
||||||
|
for feature_name in discretized_features
|
||||||
|
}
|
||||||
|
|
||||||
tf_model_initializer["features"]["discretized"] = bin_boundaries_and_weights
|
tf_model_initializer["features"]["discretized"] = bin_boundaries_and_weights
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user