def createRunner(resultsDir, profileName, resultsName=None): """Create a nab.runner.Runner object for testing.""" root = os.path.dirname(os.path.realpath(__file__)) labelPath = os.path.abspath( os.path.join(root, "..", "test_labels/labels.json")) testRunner = Runner(dataDir=None, resultsDir=resultsDir, labelPath=labelPath, profilesPath=None, thresholdPath=None) testRunner.profiles = { profileName: { "CostMatrix": { "tpWeight": 1.0 } } } if resultsName is not None: resultsFile = resultsName+'_'+profileName+'_scores.csv' resultsFilePath = os.path.join(resultsDir, resultsName, resultsFile) testRunner.resultsFiles = [resultsFilePath] return testRunner
def createRunner(resultsDir, profileName, resultsName=None): """Create a nab.runner.Runner object for testing.""" testRunner = Runner(dataDir=None, resultsDir=resultsDir, labelPath=None, profilesPath=None, thresholdPath=None) testRunner.profiles = json.loads('{"' + profileName + '": {}}') if resultsName is not None: resultsFile = resultsName + "_" + profileName + "_scores.csv" resultsFilePath = os.path.join(resultsDir, resultsName, resultsFile) testRunner.resultsFiles = [resultsFilePath] return testRunner
def createRunner(resultsDir, profileName, resultsName=None): """Create a nab.runner.Runner object for testing.""" testRunner = Runner(dataDir=None, resultsDir=resultsDir, labelPath=None, profilesPath=None, thresholdPath=None) testRunner.profiles = json.loads('{"' + profileName + '": {}}') if resultsName is not None: resultsFile = resultsName + '_' + profileName + '_scores.csv' resultsFilePath = os.path.join(resultsDir, resultsName, resultsFile) testRunner.resultsFiles = [resultsFilePath] return testRunner
def createRunner(resultsDir, profileName, resultsName=None): """Create a nab.runner.Runner object for testing.""" root = os.path.dirname(os.path.realpath(__file__)) labelPath = os.path.abspath( os.path.join(root, "..", "test_labels/labels.json")) testRunner = Runner(dataDir=None, resultsDir=resultsDir, labelPath=labelPath, profilesPath=None, thresholdPath=None) testRunner.profiles = {profileName: {"CostMatrix": {"tpWeight": 1.0}}} if resultsName is not None: resultsFile = resultsName + '_' + profileName + '_scores.csv' resultsFilePath = os.path.join(resultsDir, resultsName, resultsFile) testRunner.resultsFiles = [resultsFilePath] return testRunner