Skip to content

Commit

Permalink
Update classification_with_tfdf.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tilakrayal committed Sep 18, 2024
1 parent 8ec9402 commit 632a9b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/structured_data/md/classification_with_tfdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -1185,15 +1185,15 @@ class BinaryTargetEncoding(layers.Layer):

# Filter the data where the target label is positive.
positive_indices = tf.where(condition=target_values)
postive_feature_values = tf.gather_nd(
positive_feature_values = tf.gather_nd(
params=feature_values, indices=positive_indices
)
# Compute how many times each feature value occurred with a positive target label.
positive_frequency = tf.math.unsorted_segment_sum(
data=tf.ones(
shape=(postive_feature_values.shape[0], 1), dtype=tf.dtypes.float64
shape=(positive_feature_values.shape[0], 1), dtype=tf.dtypes.float64
),
segment_ids=postive_feature_values,
segment_ids=positive_feature_values,
num_segments=self.vocabulary_size,
)

Expand Down

0 comments on commit 632a9b3

Please sign in to comment.