def test_intrinsic_dim_mle_levina(self):
     """Test against value calc. by matlab reference implementation."""
     _, _, vector = load_dexter()
     ID_MLE_REF = 74.742
     id_mle = intrinsic_dimension(vector, k1=6, k2=12, 
         estimator='levina', metric='vector', trafo=None)
     return self.assertEqual(id_mle, int(ID_MLE_REF))
 def test_intrinsic_dim_mle_levina_low_memory(self):
     """ Same as above, but invoking the speed-memory trade-off. """
     _, _, vector = load_dexter()
     ID_MLE_REF = 74.742
     id_mle = intrinsic_dimension(vector, 6, 12, 'levina', 
                                  'vector', None, mem_threshold=0)
     return self.assertEqual(id_mle, int(ID_MLE_REF))
Example #3
0
 def test_load_dexter(self):
     """Loading dexter, checking shape of distances, labels, vectors"""
     self.dist, self.lab, self.vect = load_dexter()
     symm_dist_shape = self.dist.shape[0] == self.dist.shape[1]
     corr_dist_shape = self.dist.shape[0] == self.vect.shape[0]
     corr_label_shape = self.lab.shape[0] == self.vect.shape[0]
     return self.assertTrue(
         symm_dist_shape == corr_dist_shape == corr_label_shape)