Fix "estimator" spelling in contrib/timeseries/examples/known_anomaly.py
PiperOrigin-RevId: 210407945
This commit is contained in:
parent
dbdf0ec5b3
commit
918ec0d12f
tensorflow/contrib/timeseries/examples
@ -41,7 +41,7 @@ _MODULE_PATH = path.dirname(__file__)
|
||||
_DATA_FILE = path.join(_MODULE_PATH, "data/changepoints.csv")
|
||||
|
||||
|
||||
def state_space_esitmator(exogenous_feature_columns):
|
||||
def state_space_estimator(exogenous_feature_columns):
|
||||
"""Constructs a StructuralEnsembleRegressor."""
|
||||
|
||||
def _exogenous_update_condition(times, features):
|
||||
@ -68,7 +68,7 @@ def state_space_esitmator(exogenous_feature_columns):
|
||||
4, 64)
|
||||
|
||||
|
||||
def autoregressive_esitmator(exogenous_feature_columns):
|
||||
def autoregressive_estimator(exogenous_feature_columns):
|
||||
input_window_size = 8
|
||||
output_window_size = 2
|
||||
return (
|
||||
@ -169,10 +169,10 @@ def main(unused_argv):
|
||||
"Please install matplotlib to generate a plot from this example.")
|
||||
make_plot("Ignoring a known anomaly (state space)",
|
||||
*train_and_evaluate_exogenous(
|
||||
estimator_fn=state_space_esitmator))
|
||||
estimator_fn=state_space_estimator))
|
||||
make_plot("Ignoring a known anomaly (autoregressive)",
|
||||
*train_and_evaluate_exogenous(
|
||||
estimator_fn=autoregressive_esitmator, train_steps=3000))
|
||||
estimator_fn=autoregressive_estimator, train_steps=3000))
|
||||
pyplot.show()
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ class KnownAnomalyExampleTest(test.TestCase):
|
||||
def test_shapes_and_variance_structural_ar(self):
|
||||
(times, observed, all_times, mean, upper_limit, lower_limit,
|
||||
anomaly_locations) = known_anomaly.train_and_evaluate_exogenous(
|
||||
train_steps=1, estimator_fn=known_anomaly.autoregressive_esitmator)
|
||||
train_steps=1, estimator_fn=known_anomaly.autoregressive_estimator)
|
||||
self.assertAllEqual(
|
||||
anomaly_locations,
|
||||
[25, 50, 75, 100, 125, 150, 175, 249])
|
||||
@ -40,7 +40,7 @@ class KnownAnomalyExampleTest(test.TestCase):
|
||||
def test_shapes_and_variance_structural_ssm(self):
|
||||
(times, observed, all_times, mean, upper_limit, lower_limit,
|
||||
anomaly_locations) = known_anomaly.train_and_evaluate_exogenous(
|
||||
train_steps=50, estimator_fn=known_anomaly.state_space_esitmator)
|
||||
train_steps=50, estimator_fn=known_anomaly.state_space_estimator)
|
||||
self.assertAllEqual(
|
||||
anomaly_locations,
|
||||
[25, 50, 75, 100, 125, 150, 175, 249])
|
||||
|
Loading…
Reference in New Issue
Block a user