tfdv.DetectFeatureSkew
Stay organized with collections
Save and categorize content based on your preferences.
API for detecting feature skew between training and serving examples.
tfdv.DetectFeatureSkew(
identifier_features: List[types.FeatureName],
features_to_ignore: Optional[List[types.FeatureName]] = None,
sample_size: int = 0,
float_round_ndigits: Optional[int] = None,
allow_duplicate_identifiers: bool = False
) -> None
Example:
with beam.Pipeline(runner=...) as p:
training_examples = p | 'ReadTrainingData' >>
beam.io.ReadFromTFRecord(
training_filepaths, coder=beam.coders.ProtoCoder(tf.train.Example))
serving_examples = p | 'ReadServingData' >>
beam.io.ReadFromTFRecord(
serving_filepaths, coder=beam.coders.ProtoCoder(tf.train.Example))
_ = ((training_examples, serving_examples) | 'DetectFeatureSkew' >>
DetectFeatureSkew(identifier_features=['id1'], sample_size=5)
| 'WriteFeatureSkewResultsOutput' >>
tfdv.WriteFeatureSkewResultsToTFRecord(output_path)
| 'WriteFeatureSkwePairsOutput' >>
tfdv.WriteFeatureSkewPairsToTFRecord(output_path))
See the documentation for DetectFeatureSkewImpl for more detail about feature
skew detection.
Args |
identifier_features
|
Names of features to use as identifiers.
|
features_to_ignore
|
Names of features for which no feature skew detection
is done.
|
sample_size
|
Size of the sample of training-serving example pairs that
exhibit skew to include in the skew results.
|
float_round_ndigits
|
Number of digits precision after the decimal point to
which to round float values before comparing them.
|
allow_duplicate_identifiers
|
If set, skew detection will be done on
examples for which there are duplicate identifier feature values. In
this case, the counts in the FeatureSkew result are based on each
training-serving example pair analyzed. Examples with given identifier
feature values must all fit in memory.
|
Class Variables |
pipeline
|
None
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-04-26 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]