Пример #1
0
 def testRadon(self):
   dataset = data.radon(train_fraction=0.75)
   for k, v in dataset.items():
     if k.startswith('train_'):
       self.assertEqual((689,), v.shape)
     if k.startswith('test_'):
       self.assertEqual((230,), v.shape)
Пример #2
0
 def __init__(self):
     dataset = data.radon(state='MN')
     for key in list(dataset.keys()):
         if key.startswith('test_'):
             del dataset[key]
     super(RadonContextualEffectsMinnesota,
           self).__init__(name='radon_contextual_effects_minnesota',
                          pretty_name='Radon Contextual Effects Minnesota',
                          **dataset)
Пример #3
0
def radon_contextual_effects_minnesota():
    """Hierarchical radon model with contextual effects, with data from Minnesota.

  Returns:
    target: StanModel.
  """
    dataset = data.radon(state='MN')
    for key in list(dataset.keys()):
        if key.startswith('test_'):
            del dataset[key]
    return radon_contextual_effects.radon_contextual_effects(**dataset)
 def __init__(self, dtype=tf.float64):
     dataset = data.radon(state='MN')
     for key in list(dataset.keys()):
         if key.startswith('test_'):
             del dataset[key]
         elif dtype_util.is_floating(dataset[key].dtype):
             dataset[key] = tf.cast(dataset[key], dtype)
     super(RadonContextualEffectsMinnesota,
           self).__init__(name='radon_contextual_effects_minnesota',
                          pretty_name='Radon Contextual Effects Minnesota',
                          **dataset)