예제 #1
0
 def setUp(self):
     plpy._reset()
     self.params = {"id_col": "cartodb_id",
                    "attr1": "andy",
                    "attr2": "jay_z",
                    "table": "a_list",
                    "geom_col": "the_geom",
                    "num_ngbrs": 321}
     self.neighbors_data = json.loads(open(fixture_file('neighbors.json')).read())
     self.moran_data = json.loads(open(fixture_file('moran.json')).read())
예제 #2
0
 def setUp(self):
     plpy._reset()
     self.params = {"id_col": "cartodb_id",
                    "attr1": "andy",
                    "attr2": "jay_z",
                    "subquery": "SELECT * FROM a_list",
                    "geom_col": "the_geom",
                    "num_ngbrs": 321}
     self.params_markov = {"id_col": "cartodb_id",
                           "time_cols": ["_2013_dec", "_2014_jan", "_2014_feb"],
                           "subquery": "SELECT * FROM a_list",
                           "geom_col": "the_geom",
                           "num_ngbrs": 321}
     self.neighbors_data = json.loads(open(fixture_file('neighbors.json')).read())
     self.moran_data = json.loads(open(fixture_file('moran.json')).read())
예제 #3
0
 def setUp(self):
     plpy._reset()
     self.params = {
         "id_col": "cartodb_id",
         "attr1": "andy",
         "attr2": "jay_z",
         "subquery": "SELECT * FROM a_list",
         "geom_col": "the_geom",
         "num_ngbrs": 321,
     }
     self.params_markov = {
         "id_col": "cartodb_id",
         "time_cols": ["_2013_dec", "_2014_jan", "_2014_feb"],
         "subquery": "SELECT * FROM a_list",
         "geom_col": "the_geom",
         "num_ngbrs": 321,
     }
     self.neighbors_data = json.loads(open(fixture_file("neighbors.json")).read())
     self.moran_data = json.loads(open(fixture_file("moran.json")).read())
예제 #4
0
    def setUp(self):
        plpy._reset()
        self.params = {
            "id_col": "cartodb_id",
            "time_cols": ['dec_2013', 'jan_2014', 'feb_2014'],
            "subquery": "SELECT * FROM a_list",
            "geom_col": "the_geom",
            "num_ngbrs": 321
        }
        self.neighbors_data = json.loads(
            open(fixture_file('neighbors_markov.json')).read())
        self.markov_data = json.loads(open(fixture_file('markov.json')).read())

        self.time_data = np.array(
            [i * np.ones(10, dtype=float) for i in range(10)]).T

        self.transition_matrix = np.array(
            [[[0.96341463, 0.0304878, 0.00609756, 0., 0.],
              [0.06040268, 0.83221477, 0.10738255, 0., 0.],
              [0., 0.14, 0.74, 0.12, 0.],
              [0., 0.03571429, 0.32142857, 0.57142857, 0.07142857],
              [0., 0., 0., 0.16666667, 0.83333333]],
             [[0.79831933, 0.16806723, 0.03361345, 0., 0.],
              [0.0754717, 0.88207547, 0.04245283, 0., 0.],
              [0.00537634, 0.06989247, 0.8655914, 0.05913978, 0.],
              [0., 0., 0.06372549, 0.90196078, 0.03431373],
              [0., 0., 0., 0.19444444, 0.80555556]],
             [[0.84693878, 0.15306122, 0., 0., 0.],
              [0.08133971, 0.78947368, 0.1291866, 0., 0.],
              [0.00518135, 0.0984456, 0.79274611, 0.0984456, 0.00518135],
              [0., 0., 0.09411765, 0.87058824, 0.03529412],
              [0., 0., 0., 0.10204082, 0.89795918]],
             [[0.8852459, 0.09836066, 0., 0.01639344, 0.],
              [0.03875969, 0.81395349, 0.13953488, 0., 0.00775194],
              [0.0049505, 0.09405941, 0.77722772, 0.11881188, 0.0049505],
              [0., 0.02339181, 0.12865497, 0.75438596, 0.09356725],
              [0., 0., 0., 0.09661836, 0.90338164]],
             [[0.33333333, 0.66666667, 0., 0., 0.],
              [0.0483871, 0.77419355, 0.16129032, 0.01612903, 0.],
              [0.01149425, 0.16091954, 0.74712644, 0.08045977, 0.],
              [0., 0.01036269, 0.06217617, 0.89637306, 0.03108808],
              [0., 0., 0., 0.02352941, 0.97647059]]])
    def setUp(self):
        plpy._reset()
        self.params = {"id_col": "cartodb_id",
                       "time_cols": ['dec_2013', 'jan_2014', 'feb_2014'],
                       "subquery": "SELECT * FROM a_list",
                       "geom_col": "the_geom",
                       "num_ngbrs": 321}
        self.neighbors_data = json.loads(open(fixture_file('neighbors_markov.json')).read())
        self.markov_data = json.loads(open(fixture_file('markov.json')).read())

        self.time_data = np.array([i * np.ones(10, dtype=float) for i in range(10)]).T

        self.transition_matrix = np.array([
                [[ 0.96341463, 0.0304878 , 0.00609756, 0.        , 0.        ],
                 [ 0.06040268, 0.83221477, 0.10738255, 0.        , 0.        ],
                 [ 0.        , 0.14      , 0.74      , 0.12      , 0.        ],
                 [ 0.        , 0.03571429, 0.32142857, 0.57142857, 0.07142857],
                 [ 0.        , 0.        , 0.        , 0.16666667, 0.83333333]],
                [[ 0.79831933, 0.16806723, 0.03361345, 0.        , 0.        ],
                 [ 0.0754717 , 0.88207547, 0.04245283, 0.        , 0.        ],
                 [ 0.00537634, 0.06989247, 0.8655914 , 0.05913978, 0.        ],
                 [ 0.        , 0.        , 0.06372549, 0.90196078, 0.03431373],
                 [ 0.        , 0.        , 0.        , 0.19444444, 0.80555556]],
                [[ 0.84693878, 0.15306122, 0.        , 0.        , 0.        ],
                 [ 0.08133971, 0.78947368, 0.1291866 , 0.        , 0.        ],
                 [ 0.00518135, 0.0984456 , 0.79274611, 0.0984456 , 0.00518135],
                 [ 0.        , 0.        , 0.09411765, 0.87058824, 0.03529412],
                 [ 0.        , 0.        , 0.        , 0.10204082, 0.89795918]],
                [[ 0.8852459 , 0.09836066, 0.        , 0.01639344, 0.        ],
                 [ 0.03875969, 0.81395349, 0.13953488, 0.        , 0.00775194],
                 [ 0.0049505 , 0.09405941, 0.77722772, 0.11881188, 0.0049505 ],
                 [ 0.        , 0.02339181, 0.12865497, 0.75438596, 0.09356725],
                 [ 0.        , 0.        , 0.        , 0.09661836, 0.90338164]],
                [[ 0.33333333, 0.66666667, 0.        , 0.        , 0.        ],
                 [ 0.0483871 , 0.77419355, 0.16129032, 0.01612903, 0.        ],
                 [ 0.01149425, 0.16091954, 0.74712644, 0.08045977, 0.        ],
                 [ 0.        , 0.01036269, 0.06217617, 0.89637306, 0.03108808],
                 [ 0.        , 0.        , 0.        , 0.02352941, 0.97647059]]]
                 )
예제 #6
0
 def setUp(self):
     plpy._reset()
     self.cluster_data = json.loads(open(fixture_file('kmeans.json')).read())
     self.params = {"subquery": "select * from table",
                    "no_clusters": "10"
                    }
 def setUp(self):
     plpy._reset()
     self.cluster_data = json.loads(
         open(fixture_file('kmeans.json')).read())
     self.params = {"subquery": "select * from table", "no_clusters": "10"}
 def setUp(self):
     plpy._reset()
예제 #9
0
 def setUp(self):
     plpy._reset()