def setUp(self): importr('fpp') self.oil_ts = robjects.r('oil') self.aus_ts = robjects.r('austourists') self.fc_oil = wrappers.meanf(self.oil_ts) self.fc_aus = wrappers.ets(self.aus_ts) self.oil = ts_io.read_series('data/oil.csv') self.aus = ts_io.read_series('data/aus.csv') self.data = [0.74, 0.42, 0.22, 0.04, 0.17, 0.37, 0.53, 0.32, 0.82, 0.81, 0.11, 0.79] self.npdata = numpy.array(self.data)
def setUp(self): importr('fpp') self.oil_ts = robjects.r('oil') self.aus_ts = robjects.r('austourists') self.fc_oil = wrappers.meanf(self.oil_ts) self.fc_aus = wrappers.ets(self.aus_ts) self.oil = ts_io.read_series('data/oil.csv') self.aus = ts_io.read_series('data/aus.csv') self.data = [ 0.74, 0.42, 0.22, 0.04, 0.17, 0.37, 0.53, 0.32, 0.82, 0.81, 0.11, 0.79 ] self.npdata = numpy.array(self.data)
def test_read_series(self): # The no-index case: oil2 = ts_io.read_series('data/oil2.csv') self.assertEqual(len(oil2), 46) self.assertListEqual(list(oil2.index), range(1, 46 + 1)) # The non-seasonal index case: oil = ts_io.read_series('data/oil.csv') self.assertEqual(len(oil), 46) self.assertListEqual(list(oil.index), range(1965, 2011)) # The seasonal index case: aus = ts_io.read_series('data/aus.csv') self.assertEqual(len(aus), 48) self.assertEqual(aus.index.nlevels, 2) # This has 4 columns, and should raise an IOError: self.assertRaises(IOError, ts_io.read_series, 'data/bad.csv')
def setUp(self): self.oil = ts_io.read_series('data/oil.csv') self.oil_ts = converters.series_as_ts(self.oil) self.mat = converters.matrix([[1,2,3],[2,3,4]]) self.acc = wrappers.accuracy(wrappers.thetaf(self.oil_ts))
def setUp(self): self.oil = ts_io.read_series('data/oil.csv') self.aus = ts_io.read_series('data/aus.csv') self.austa = ts_io.read_ts('austa', 'fpp')