Example #1
0
    def test_REDCAP_fullward(self):
        k = 5
        clusters = pygeoda.redcap(k, self.queen_w, self.data,
                                  "fullorder-wardlinkage")

        self.assertAlmostEqual(
            clusters["The ratio of between to total sum of squares"],
            0.42268567324507456)
Example #2
0
    def test_REDCAP_fullaverage(self):
        k = 5
        clusters = pygeoda.redcap(k, self.queen_w, self.data,
                                  "fullorder-averagelinkage")

        self.assertAlmostEqual(
            clusters["The ratio of between to total sum of squares"],
            0.3854425827224785)
Example #3
0
    def test_REDCAP_fullsingle(self):
        k = 5
        clusters = pygeoda.redcap(k, self.queen_w, self.data,
                                  "fullorder-singlelinkage")

        self.assertAlmostEqual(
            clusters["The ratio of between to total sum of squares"],
            0.33931921310113483)
Example #4
0
    def test_REDCAP_fullcomplete(self):
        k = 5
        clusters = pygeoda.redcap(k, self.queen_w, self.data,
                                  "fullorder-completelinkage")

        self.assertAlmostEqual(
            clusters["The ratio of between to total sum of squares"],
            0.39420885009615186)
Example #5
0
    def test_REDCAP_firstsingle(self):
        k = 5
        clusters = pygeoda.redcap(k, self.queen_w, self.data,
                                  "firstorder-singlelinkage")

        self.assertAlmostEqual(
            clusters["The ratio of between to total sum of squares"],
            0.3763086808858706)