コード例 #1
0
ファイル: junit_test5.py プロジェクト: arhik/nupic.research
def runExperiment(args):
    """ Build a model and test it."""
    model, dataSet = setupExperiment(args)

    allRanks, avgRanks, avgStats = testModel(
        model, [d for d in dataSet if d[2] % 100 == 0], categorySize=6, verbosity=args.verbosity
    )
    printRankResults("JUnit5", avgRanks, avgStats)

    return model
コード例 #2
0
ファイル: junit_test1.py プロジェクト: vaua/nupic.research
def runExperiment(args):
    """ Build a model, test it, print and return results metrics."""
    model, dataSet = setupExperiment(args)

    allRanks, avgRanks, avgStats = testModel(model,
                                             dataSet,
                                             categorySize=CATEGORY_SIZE,
                                             verbosity=args.verbosity)
    printRankResults("JUnit1", avgRanks, avgStats)

    return allRanks, avgRanks, avgStats
コード例 #3
0
def runExperiment(args):
  """ Build a model, test it, print and return results metrics."""
  model, dataSet = setupExperiment(args)

  allRanks, avgRanks, avgStats = testModel(model,
                           dataSet,
                           categorySize=CATEGORY_SIZE,
                           verbosity=args.verbosity)
  printRankResults("JUnit1", avgRanks, avgStats)

  return allRanks, avgRanks, avgStats
コード例 #4
0
def runExperiment(args):
    """ Build a model and test it."""
    model, dataSet = setupExperiment(args)

    allRanks, avgRanks, avgStats = testModel(
        model, [d for d in dataSet if d[2] % 100 == 0],
        categorySize=6,
        verbosity=args.verbosity)
    printRankResults("JUnit5", avgRanks, avgStats)

    return model
コード例 #5
0
ファイル: junit_test2.py プロジェクト: arhik/nupic.research
def runExperiment(args, testIndex=0):
    """ Build a model and test it.
  @param testIndex (int) Specifies the doc of each group we use for inference.
  """
    model, dataSet = setupExperiment(args)

    allRanks, avgRanks, avgStats = testModel(
        model, [d for d in dataSet if d[2] % 100 == testIndex], categorySize=CATEGORY_SIZE, verbosity=args.verbosity
    )
    printRankResults("JUnit2", avgRanks, avgStats)

    return allRanks, avgRanks, avgStats
コード例 #6
0
def runExperiment(args):
  """ Build a model and test it."""
  # TODO: args.verbosity deprecated b/c PrettyTable formatting can't handle
  # large text items.
  args.verbosity = 0

  model, dataSet = setupExperiment(args)

  allRanks, avgRanks, avgStats = testModel(model,
                    [d for d in dataSet if d[2]%100==0],
                    categorySize=CATEGORY_SIZE,
                    verbosity=args.verbosity)
  printRankResults("JUnit4", avgRanks, avgStats)

  return allRanks, avgRanks, avgStats
コード例 #7
0
ファイル: junit_test2.py プロジェクト: vaua/nupic.research
def runExperiment(args, testIndex=0):
  """ Build a model and test it.
  @param testIndex (int) Specifies the doc of each group we use for inference.
  """
  model, dataSet = setupExperiment(args)

  allRanks, avgRanks, avgStats = testModel(
    model,
    [d for d in dataSet if d[2]%100==testIndex],
    categorySize=CATEGORY_SIZE,
    verbosity=args.verbosity
  )
  printRankResults("JUnit2", avgRanks, avgStats)

  return allRanks, avgRanks, avgStats
コード例 #8
0
ファイル: junit_test4.py プロジェクト: vaua/nupic.research
def runExperiment(args):
    """ Build a model and test it."""

    # Filtering text helps word level and union pooler models for test 4.
    # It does not help keywords or document fingerprint models.
    if args.modelName == "htm":
        args.filterText = True

    model, dataSet = setupExperiment(args)

    allRanks, avgRanks, avgStats = testModel(
        model, [d for d in dataSet if d[2] % 100 == 0],
        categorySize=CATEGORY_SIZE,
        verbosity=args.verbosity)
    printRankResults("JUnit4", avgRanks, avgStats)

    return allRanks, avgRanks, avgStats
コード例 #9
0
def runExperiment(args):
  """ Build a model and test it."""

  # Filtering text helps word level and union pooler models for test 4.
  # It does not help keywords or document fingerprint models.
  if args.modelName == "htm":
    args.filterText = True

  model, dataSet = setupExperiment(args)

  allRanks, avgRanks, avgStats = testModel(
    model,
    [d for d in dataSet if d[2]%100==0],
    categorySize=CATEGORY_SIZE,
    verbosity=args.verbosity
  )
  printRankResults("JUnit4", avgRanks, avgStats)

  return allRanks, avgRanks, avgStats
コード例 #10
0
ファイル: junit_test3.py プロジェクト: vaua/nupic.research
def runExperiment(args):
  """ Build a model and test it."""
  model, dataSet = setupExperiment(args)

  if args.testB:
    allRanks, avgRanks, avgStats = testModel(model,
                                           [d for d in dataSet if d[2]%100==0],
                                           categorySize=CATEGORY_SIZE,
                                           verbosity=args.verbosity)
    printRankResults("JUnit3B", avgRanks, avgStats)

  else:
    allRanks, avgRanks, avgStats = testModel(model,
                                           dataSet,
                                           categorySize=CATEGORY_SIZE,
                                           verbosity=args.verbosity)
    printRankResults("JUnit3", avgRanks, avgStats)

  return allRanks, avgRanks, avgStats