google_cloud_pipeline_components.experimental.tensorflow_probability.anomaly_detection.tfp_anomaly_detection module

Anomaly detection component using TensorFlow Probability.

google_cloud_pipeline_components.experimental.tensorflow_probability.anomaly_detection.tfp_anomaly_detection.tfp_anomaly_detection(input_dataset: kfp.v2.components.types.artifact_types.Dataset[kfp.v2.components.types.artifact_types.Dataset], output_dataset: kfp.v2.components.types.artifact_types.Dataset[kfp.v2.components.types.artifact_types.Dataset], time_col: str = 'timestamp', feature_col: str = 'value', timestamp_format: str = '%Y-%m-%d %H:%M:%S', anomaly_threshold: float = 0.01, use_gibbs_predictive_dist: bool = True, num_warmup_steps: int = 50, num_samples: int = 100, jit_compile: bool = False, seed: Optional[int] = None)

Uses TFP STS detect_anomalies to regularize a time series, fit a model, and predict anomalies.


input_dataset: Input with GCS path to input time series csv. output_dataset: Output with GCS path to output predictions csv. time_col: Name of csv column with timestamps. feature_col: Name of csv column with feature values. timestamp_format: Datetime format to serialize timestamps with. anomaly_threshold: Confidence level for anomaly detection. use_gibbs_predictive_dist: Whether the predictive distribution is derived

from Gibbs samples of the latent level.

num_warmup_steps: Number of steps to take before collecting samples. num_samples: Number of steps to take while sampling parameter values. jit_compile: Whether to compile the sampler with XLA. seed: PRNG seed.

Path to output predictions csv with the following fields

timestamp: Timestamps from the input time series. value: Observed values from the input time series. anomaly_score: Probability that the data point is an anomaly. tail_probability: Probability that the data point occurs. label: Whether the data point is predicted to be an anomaly. lower_limit: Lowest acceptable forecast value from model. mean: Mean forecast value from model. upper_limit: Highest acceptable forecast value from model.