Exemple #1
0
    everySecond = [x for x in xrange(4 * 39) if x % 4 == 1]
    everyThird = [x for x in xrange(4 * 39) if x % 4 == 2]
    everyFourth = [x for x in xrange(4 * 39) if x % 4 == 3]

    dataSev = np.array(datanmaM)

    print "Correlation no pooling - no pooling in several"
    print np.corrcoef(np.vstack([dataSev[everyFirst], dataNo]))
    print "Correlation avg - avg in several"
    print np.corrcoef(np.vstack([dataSev[everySecond], dataAvg]))
    print "Correlation min - min in several"
    print np.corrcoef(np.vstack([dataSev[everyThird], dataMin]))
    print "Correlation max - max in several"
    print np.corrcoef(np.vstack([dataSev[everyFourth], dataMax]))

    pl.figure()
    pl.xlabel("features")
    pl.ylabel("Cumulative importance")
    pl.plot(getCumulFreq(dataNo), ".m")
    pl.plot(getCumulFreq(dataAvg), "--b")
    pl.plot(getCumulFreq(dataMin), "*g")
    pl.plot(getCumulFreq(dataMax), "-r")
    pl.ylim(0, 1.0)
    pl.xlim(0, 39)
    legend = ["No pooling (acc. : 0.4816)"]
    legend += ["3x3 avgerage (acc. : 0.5057)"]
    legend += ["3x3 minumum (acc. : 0.5151)"]
    legend += ["3x3 maxumum (acc. : 0.5476)"]
    pl.legend(legend, loc=4)
    pl.title("Cumulative importance histogram")
Exemple #2
0
    t6 = [ 0.0328192, 0.0000162, 0.0000000, 0.0205055, 0.0010517, 0.0000003, 0.0181865, 0.0064756, 0.0022117, 0.0001378, 0.0020987, 0.0133829, 0.0001653, 0.0028567, 0.0258848, 0.0029010, 0.0001145, 0.0144010, 0.0030484, 0.0037526, 0.0181241, 0.0206085, 0.0218777, 0.0011795, 0.0227901, 0.0200222, 0.0193735, 0.0214514, 0.0002779, 0.0001071, 0.0031945, 0.0010239, 0.0015832, 0.0055839, 0.0014841, 0.0229047, 0.0030153, 0.0008908, 0.0118412, 0.0193382, 0.0093411, 0.0002686, 0.0000041, 0.0043802, 0.0041224, 0.0175515, 0.0013307, 0.0002745, 0.0091915, 0.0246439, 0.0003758, 0.0227945, 0.0111779, 0.0175543, 0.0000205, 0.0000840, 0.0201769, 0.0071613, 0.0222881, 0.0096364, 0.0109539, 0.0127562, 0.0280986, 0.0064150, 0.0161116, 0.0003182, 0.0006590, 0.0170023, 0.0063290, 0.0207728, 0.0214311, 0.0254398, 0.0340206, 0.0000262, 0.0084059, 0.0098547, 0.0001430, 0.0213732, 0.0003574, 0.0196660, 0.0008667, 0.0205489, 0.0000742, 0.0002274, 0.0180293, 0.0018641, 0.0019685, 0.0012130, 0.0249545, 0.0010144, 0.0001377, 0.0018851, 0.0214908, 0.0052449, 0.0095330, 0.0327336, 0.0171330, 0.0066602, 0.0005003, 0.0238996, 0.0008261, ]
    t7  = [ 0.0253439, 0.0139213, 0.0182176, 0.0168618, 0.0001973, 0.0176249, 0.0000143, 0.0080068, 0.0033587, 0.0148197, 0.0203563, 0.0001428, 0.0038726, 0.0000036, 0.0137441, 0.0018900, 0.0088896, 0.0032599, 0.0004890, 0.0074016, 0.0177672, 0.0066011, 0.0156306, 0.0000901, 0.0139537, 0.0081204, 0.0163764, 0.0009208, 0.0001103, 0.0008850, 0.0000142, 0.0000004, 0.0002928, 0.0134085, 0.0102989, 0.0000549, 0.0255537, 0.0027909, 0.0192480, 0.0109953, 0.0234356, 0.0158317, 0.0020065, 0.0057718, 0.0071534, 0.0155347, 0.0181842, 0.0272049, 0.0022969, 0.0155503, 0.0189430, 0.0123894, 0.0001199, 0.0000323, 0.0041062, 0.0050620, 0.0167378, 0.0215865, 0.0009897, 0.0266402, 0.0000000, 0.0150348, 0.0050886, 0.0171035, 0.0076015, 0.0001396, 0.0140118, 0.0174543, 0.0032445, 0.0055138, 0.0201418, 0.0133815, 0.0183637, 0.0107581, 0.0030568, 0.0165407, 0.0034706, 0.0137335, 0.0138512, 0.0168494, 0.0232178, 0.0114565, 0.0206342, 0.0076597, 0.0012201, 0.0097618, 0.0046694, 0.0024770, 0.0045426, 0.0187703, 0.0186445, 0.0023495, 0.0197462, 0.0008506, 0.0000689, 0.0137239, 0.0093438, 0.0019296, 0.0089550, 0.0142297, 0.0093032, ]
    t8 = [ 0.0240553, 0.0041456, 0.0087262, 0.0066786, 0.0004766, 0.0175053, 0.0241431, 0.0199893, 0.0000057, 0.0165096, 0.0080852, 0.0181808, 0.0050640, 0.0078160, 0.0115205, 0.0000969, 0.0007722, 0.0007187, 0.0146199, 0.0171164, 0.0184542, 0.0000056, 0.0055488, 0.0242925, 0.0000237, 0.0000260, 0.0051930, 0.0001518, 0.0000728, 0.0114980, 0.0000351, 0.0182320, 0.0046038, 0.0167474, 0.0200962, 0.0023580, 0.0002064, 0.0169880, 0.0093137, 0.0249682, 0.0178060, 0.0000811, 0.0000020, 0.0208692, 0.0000580, 0.0035430, 0.0173731, 0.0070604, 0.0186594, 0.0150812, 0.0148293, 0.0247627, 0.0177812, 0.0174275, 0.0000468, 0.0183964, 0.0065898, 0.0000225, 0.0163724, 0.0000159, 0.0256773, 0.0077829, 0.0017248, 0.0029000, 0.0000656, 0.0149626, 0.0005949, 0.0000316, 0.0012407, 0.0044655, 0.0002493, 0.0188393, 0.0081428, 0.0000007, 0.0057743, 0.0167160, 0.0231689, 0.0011918, 0.0200111, 0.0232226, 0.0105049, 0.0001102, 0.0182506, 0.0159787, 0.0065356, 0.0178784, 0.0241331, 0.0089387, 0.0000302, 0.0075883, 0.0107346, 0.0197452, 0.0041421, 0.0147649, 0.0010424, 0.0000000, 0.0161368, 0.0056364, 0.0159563, 0.0149744, 0.0083365, ]
    t9 = [ 0.0306774, 0.0280253, 0.0180546, 0.0166627, 0.0188198, 0.0170886, 0.0206301, 0.0204440, 0.0000006, 0.0008056, 0.0216706, 0.0004212, 0.0201777, 0.0127271, 0.0128560, 0.0223716, 0.0196597, 0.0029876, 0.0183454, 0.0022747, 0.0228676, 0.0192782, 0.0031940, 0.0002840, 0.0032051, 0.0246981, 0.0181457, 0.0005404, 0.0234416, 0.0055278, 0.0223227, 0.0060283, 0.0209760, 0.0049289, 0.0000015, 0.0092275, 0.0000108, 0.0112986, 0.0117662, 0.0036773, 0.0000027, 0.0000047, 0.0160939, 0.0057185, 0.0005844, 0.0004858, 0.0070657, 0.0000214, 0.0146114, 0.0000126, 0.0185708, 0.0187537, 0.0006246, 0.0002145, 0.0006180, 0.0060985, 0.0024567, 0.0171043, 0.0097870, 0.0034056, 0.0003876, 0.0106905, 0.0216777, 0.0000202, 0.0177508, 0.0115915, 0.0040464, 0.0059609, 0.0049723, 0.0016140, 0.0273042, 0.0262658, 0.0171176, 0.0195676, 0.0180274, 0.0027282, 0.0003785, 0.0008771, 0.0002629, 0.0019789, 0.0057740, 0.0000441, 0.0175432, 0.0016267, 0.0182228, 0.0180318, 0.0001774, 0.0009187, 0.0001560, 0.0003404, 0.0177764, 0.0136312, 0.0077836, 0.0015302, 0.0144836, 0.0227217, 0.0080447, 0.0175010, 0.0010949, 0.0000668, 0.0009551, ]
    t10 = [ 0.0337587, 0.0049137, 0.0230405, 0.0004900, 0.0082793, 0.0033819, 0.0205907, 0.0001274, 0.0101716, 0.0000537, 0.0147483, 0.0236076, 0.0202671, 0.0000316, 0.0238104, 0.0190257, 0.0058685, 0.0192716, 0.0149494, 0.0001089, 0.0048424, 0.0075114, 0.0226976, 0.0214111, 0.0248326, 0.0000288, 0.0013230, 0.0170462, 0.0196987, 0.0037636, 0.0073065, 0.0124228, 0.0018091, 0.0001057, 0.0000445, 0.0098302, 0.0009028, 0.0152320, 0.0161817, 0.0037123, 0.0000041, 0.0259695, 0.0001470, 0.0131714, 0.0004236, 0.0121409, 0.0141851, 0.0025172, 0.0001440, 0.0007240, 0.0207984, 0.0003382, 0.0057613, 0.0064627, 0.0000075, 0.0069718, 0.0226850, 0.0010131, 0.0099068, 0.0161651, 0.0002190, 0.0004468, 0.0006868, 0.0002284, 0.0181019, 0.0348175, 0.0006017, 0.0070557, 0.0024535, 0.0231797, 0.0190730, 0.0000156, 0.0016091, 0.0201419, 0.0197478, 0.0000651, 0.0188831, 0.0001170, 0.0056172, 0.0055288, 0.0136530, 0.0136576, 0.0097006, 0.0160984, 0.0052960, 0.0177528, 0.0192247, 0.0001780, 0.0258125, 0.0052222, 0.0085032, 0.0040518, 0.0000643, 0.0209313, 0.0197635, 0.0007295, 0.0051464, 0.0003594, 0.0000013, 0.0086411, 0.0298866, ]

    matrix = np.vstack([usual, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10])
    corrMat = np.corrcoef(matrix)
    print corrMat



    pl.figure()
    pl.xlabel("features")
    pl.ylabel("Cumulative importance")
    pl.plot(getCumulFreq(usual), ".b")
    pl.plot(getCumulFreq(t1), "--r")
    pl.plot(getCumulFreq(t5), "*c")
    pl.plot(getCumulFreq(t6), "-g")
    pl.plot(getCumulFreq(t10), "+m")
    pl.ylim(0, 1.)
    pl.xlim(0, 80)
    legend = ["Test 0 (acc. : 0.5151)"]
    legend += ["Test 1 (acc. : 0.5183)"]
    legend += ["Test 5 (acc. : 0.5094)"]
    legend += ["Test 6 (acc. : 0.5093)"]
    legend += ["Test 10 (acc. : 0.5124)"]
    pl.legend(legend, loc=4)
    pl.title("Cumulative importance histogram")
    #pl.legend(legend, loc=4)