コード例 #1
0
 # pylab.ylabel('True positive rate')
 # pylab.xlabel('False positive rate')
 # pylab.axis([0, 1, 0, 1])
 # pylab.savefig('9-results/roc.png')
 # Initialize
 radius = 25
 radiusInfos = []
 length = 50
 lengthInfos = []
 scanInformationByPath = loadInformations('probabilities', '.')
 # For each scanInformation,
 for scanFolderPath, scanInformation in scanInformationByPath.iteritems():
     # Initialize
     scanPath = os.path.join(scanFolderPath, folder_store.fileNameByFolderName['probabilities'])
     # Evaluate with radius
     radiusInfos.append(evaluation_process.evaluateWindowsByRadius(scanPath, radius))
     # Evaluate with length
     lengthInfos.append(evaluation_process.evaluateWindowsByLength(scanPath, length))
 # Plot with radius
 pylab.figure()
 pylab.plot([x['recall'] for x in radiusInfos], [x['precision'] for x in radiusInfos], '*')
 pylab.title('Evaluation of scan using relative circles (circle radius of %s meters)' % radius)
 pylab.ylabel('Precision (Percent of predicted that are actual)')
 pylab.xlabel('Recall (Percent of actual that are predicted)')
 pylab.axis([0, 1, 0, 1])
 pylab.savefig(expandPath('scanEvaluationByRadius.png'))
 # Plot with length
 pylab.figure()
 pylab.plot([x['false positive rate'] for x in lengthInfos], [x['true positive rate'] for x in lengthInfos], '*')
 pylab.title('Evaluation of scan using absolute rectangles (rectangle length of %s meters)' % length)
 pylab.ylabel('True positive rate')