Exemplo n.º 1
0
def is_R_accuracy(acc):
  if type(acc) is robjects.Matrix:
    cnames = colnames(acc)
    r, c = dim(acc)
    if ('matrix' in cls(acc) 
        and 'MASE' in cnames 
        and r in {1,2} and c in {7,8}):
      return True
  return False
 def testCls(self):
   self.assertTrue('ts' in rbase.cls(self.oil_ts))
   self.assertRaises(TypeError, rbase.cls, self.oil)
Exemplo n.º 3
0
def is_R_forecast(fc):
  return type(fc) is robjects.ListVector and 'forecast' in cls(fc)
Exemplo n.º 4
0
def is_R_matrix(x):
  return type(x) is robjects.Matrix and 'matrix' in cls(x)
Exemplo n.º 5
0
def is_R_ts(x):
  return type(x) is robjects.FloatVector and 'ts' in cls(x)
Exemplo n.º 6
0
def is_R_decomposition(dc):
  return (type(dc) is robjects.ListVector 
          and cls(dc)[0] in ['stl', 'decomposed.ts'])