Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/a/z/AZOrange-HEAD/tests/source/AZevalUtilitiesTest.py   AZOrange(Download)
 
 
        MD1 = similarityMetrics.calcMahalanobis(data, testData)
        MD2 = similarityMetrics.calcMahalanobis(data, testData, invCovMatFile, centerFile, MahalanobisData, domain)
        expected = [{'_train_id_near1': 'XX', '_train_dist_near1': 8.5529724254000528e-15, '_train_dist_near2': 3.2469494012727824, '_train_id_near2': 'XX', '_train_dist_near3': 3.2731657154209062, '_train_av3nearest': 2.1733717055645658, '_train_SMI_near3': 'XXX', '_train_id_near3': 'XX', '_train_SMI_near1': 'XXX', '_train_SMI_near2': 'XXX', '_MD': 17.204748057165233}, {'_train_id_near1': 'XX', '_train_dist_near1': 5.115384476164845, '_train_dist_near2': 5.5191228149142137, '_train_id_near2': 'XX', '_train_dist_near3': 5.5944864806135319, '_train_av3nearest': 5.4096645905641978, '_train_SMI_near3': 'XXX', '_train_id_near3': 'XX', '_train_SMI_near1': 'XXX', '_train_SMI_near2': 'XXX', '_MD': 32.561505764913186}, {'_train_id_near1': 'XX', '_train_dist_near1': 4.2608827352786338e-15, '_train_dist_near2': 2.7885310210397281, '_train_id_near2': 'XX', '_train_dist_near3': 2.7885310210397281, '_train_av3nearest': 1.8590206806931533, '_train_SMI_near3': 'XXX', '_train_id_near3': 'XX', '_train_SMI_near1': 'XXX', '_train_SMI_near2': 'XXX', '_MD': 14.565865561707858}, {'_train_id_near1': 'XX', '_train_dist_near1': 5.1696950502912085e-15, '_train_dist_near2': 3.2469494012428579, '_train_id_near2': 'XX', '_train_dist_near3': 3.273165715391364, '_train_av3nearest': 2.1733717055447421, '_train_SMI_near3': 'XXX', '_train_id_near3': 'XX', '_train_SMI_near1': 'XXX', '_train_SMI_near2': 'XXX', '_MD': 17.204748056995847}, {'_train_id_near1': 'XX', '_train_dist_near1': 2.3478624106042396, '_train_dist_near2': 3.9525803005509639, '_train_id_near2': 'XX', '_train_dist_near3': 3.9997921263766512, '_train_av3nearest': 3.4334116125106182, '_train_SMI_near3': 'XXX', '_train_id_near3': 'XX', '_train_SMI_near1': 'XXX', '_train_SMI_near2': 'XXX', '_MD': 22.070533877619617}, {'_train_id_near1': 'XX', '_train_dist_near1': 3.2549006987559131e-15, '_train_dist_near2': 3.2469494012420288, '_train_id_near2': 'XX', '_train_dist_near3': 3.2731657153902853, '_train_av3nearest': 2.1733717055441057, '_train_SMI_near3': 'XXX', '_train_id_near3': 'XX', '_train_SMI_near1': 'XXX', '_train_SMI_near2': 'XXX', '_MD': 17.204748057000234}, {'_train_id_near1': 'XX', '_train_dist_near1': 1.887904134152689, '_train_dist_near2': 3.0871126343782667, '_train_id_near2': 'XX', '_train_dist_near3': 3.0950749249075327, '_train_av3nearest': 2.6900305644794962, '_train_SMI_near3': 'XXX', '_train_id_near3': 'XX', '_train_SMI_near1': 'XXX', '_train_SMI_near2': 'XXX', '_MD': 16.634324652887784}]
    def testQuantileCalc(self):
 
        MD = similarityMetrics.calcMahalanobis(self.trainData, self.testData)
        quantiles = similarityMetrics.calcMahalanobisDistanceQuantiles(MD)
        self.assertEqual(round(quantiles[0],3), round(1.1802994935528328,3))