Esempio n. 1
0
 def testRadonIndiana(self):
     dataset = data.radon_indiana(train_fraction=0.75)
     for k, v in dataset.items():
         if k.startswith('train_'):
             self.assertEqual((1388, ), tf.convert_to_tensor(v).shape)
         if k.startswith('test_'):
             self.assertEqual((463, ), tf.convert_to_tensor(v).shape)
Esempio n. 2
0
 def __init__(self, dtype=tf.float32):
     dataset = data.radon_indiana()
     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(RadonContextualEffectsIndiana,
           self).__init__(name='radon_contextual_effects_indiana',
                          pretty_name='Radon Contextual Effects Indiana',
                          **dataset)
Esempio n. 3
0
def radon_contextual_effects_indiana():
    """Hierarchical radon model with contextual effects, with data from Indiana.

  Returns:
    target: StanModel.
  """
    dataset = data.radon_indiana()
    for key in list(dataset.keys()):
        if key.startswith('test_'):
            del dataset[key]
    return radon_contextual_effects.radon_contextual_effects(**dataset)