Exemplo n.º 1
0
 def test_csv_no_data(self):
     filename = _make_csv_time_series(num_features=1,
                                      num_samples=0,
                                      test_tmpdir=self.get_temp_dir())
     time_series_reader = input_pipeline.CSVReader([filename])
     with self.assertRaises(errors.OutOfRangeError):
         self._test_out_of_order(time_series_reader,
                                 discard_out_of_order=True)
Exemplo n.º 2
0
 def test_csv_no_data(self):
     filename = _make_csv_time_series(num_features=1,
                                      num_samples=0,
                                      test_tmpdir=self.get_temp_dir())
     time_series_reader = input_pipeline.CSVReader([filename])
     with self.assertRaises(errors.OutOfRangeError):
         self._whole_dataset_input_fn_test_template(
             time_series_reader=time_series_reader,
             num_features=1,
             num_samples=50)
Exemplo n.º 3
0
 def test_csv_multivariate(self):
     filename = _make_csv_time_series(num_features=2,
                                      num_samples=50,
                                      test_tmpdir=self.get_temp_dir())
     time_series_reader = input_pipeline.CSVReader(
         [filename],
         column_names=(TrainEvalFeatures.TIMES, TrainEvalFeatures.VALUES,
                       TrainEvalFeatures.VALUES))
     self._test_multivariate(time_series_reader=time_series_reader,
                             num_features=2)
Exemplo n.º 4
0
 def test_csv(self):
     filename = _make_csv_time_series(num_features=1,
                                      num_samples=50,
                                      test_tmpdir=self.get_temp_dir())
     time_series_reader = input_pipeline.CSVReader(
         [filename],
         column_names=(TrainEvalFeatures.TIMES, TrainEvalFeatures.VALUES))
     self._all_window_input_fn_test_template(
         time_series_reader=time_series_reader,
         num_samples=50,
         window_size=10)
Exemplo n.º 5
0
 def test_csv_discard_out_of_order_window_equal(self):
     filename = _make_csv_time_series(num_features=1,
                                      num_samples=3,
                                      test_tmpdir=self.get_temp_dir())
     time_series_reader = input_pipeline.CSVReader([filename])
     self._random_window_input_fn_test_template(
         time_series_reader=time_series_reader,
         num_features=1,
         window_size=3,
         batch_size=5,
         discard_out_of_order=True)
Exemplo n.º 6
0
 def test_csv_discard_out_of_order_window_too_large(self):
     filename = _make_csv_time_series(num_features=1,
                                      num_samples=2,
                                      test_tmpdir=self.get_temp_dir())
     time_series_reader = input_pipeline.CSVReader([filename])
     with self.assertRaises(errors.OutOfRangeError):
         self._random_window_input_fn_test_template(
             time_series_reader=time_series_reader,
             num_features=1,
             window_size=3,
             batch_size=5,
             discard_out_of_order=True)
Exemplo n.º 7
0
 def test_csv_discard_out_of_order(self):
     filename = _make_csv_time_series(num_features=1,
                                      num_samples=50,
                                      test_tmpdir=self.get_temp_dir())
     time_series_reader = input_pipeline.CSVReader([filename])
     self._test_out_of_order(time_series_reader, discard_out_of_order=True)