예제 #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)
예제 #3
0
def is_R_forecast(fc):
  return type(fc) is robjects.ListVector and 'forecast' in cls(fc)
예제 #4
0
def is_R_matrix(x):
  return type(x) is robjects.Matrix and 'matrix' in cls(x)
예제 #5
0
def is_R_ts(x):
  return type(x) is robjects.FloatVector and 'ts' in cls(x)
예제 #6
0
def is_R_decomposition(dc):
  return (type(dc) is robjects.ListVector 
          and cls(dc)[0] in ['stl', 'decomposed.ts'])