Skip to content

In-memory Modes #29

@hayesall

Description

@hayesall

Good first part to #28 : Extract a small API to set the modes directly in Java instead of loading them from a file every time.


Running something like this:

package edu.wisc.cs.will;

import edu.wisc.cs.will.Boosting.Common.RunBoostedModels;

public class RunToyCancer
{
    public void runToyCancerLearnInfer() {
        String[] trainArgs = {"-l", "-train", "/toy_cancer/train/", "-target", "cancer", "-trees", "10"};
        RunBoostedModels.main(trainArgs);

        String[] testArgs = {"-i", "-model", "/toy_cancer/train/models/", "-test", "/toy_cancer/test/", "-target", "cancer"};
        RunBoostedModels.main(testArgs);
    }
}

Passes a list of _pos, _neg, _facts, and _bk files between objects, eventually ending up as buffered readers in ILPOuterLoop and LearnOneClause.

Start with something like this:

public void runTC()
{
  String newline = System.getProperty("line.separator");
  String localModes = String.join(
          newline,
          "usePrologVariables: true.",
          "mode: friends(+person,-person).",
          "mode: friends(-person,+person).",
          "mode: smokes(+person).",
          "mode: cancer(+person)."
  );

  // Fill
  // String[] trainArgs = {""};

  RunBoostedModels.newMain(trainArgs, localModes);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions