GithubHelp home page GithubHelp logo

mwt-ds-explore-java's Introduction

Build Status Windows Build Status

Exploration Library

The exploration library addresses the ‘gathering the data’ aspect of machine learning rather than the ‘using the data’ aspect we are most familiar with. The primary goal here is to enable individuals (i.e. you) to gather the right data for using machine learning for interventions in a live system based on user feedback (click, dwell, correction, etc…). Empirically, gathering the right data has often made a substantial difference. Theoretically, we know it is required to disentangle causation from correlation effectively in general.

First version of client-side exploration library that includes the following exploration algorithms:

  • Epsilon Greedy
  • Tau First
  • Softmax
  • Bootstrap
  • Generic (users can specify custom weight for every action)

This release supports Java. For other languages, see:

For sample usage, see:

For more details on Multiworld Testing as a Service, visit

mwt-ds-explore-java's People


deaktator avatar lhoang29 avatar microsoft-github-policy-service[bot] avatar slbird avatar tomerk avatar


 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar


 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mwt-ds-explore-java's Issues

Refactor code to avoid random access where it's unnecessary

There are a lot of places where java.util.List iteration follows the pattern:

java.util.List<X> lst = ...
for (int i = 0; i < lst.size; i++) {
  doSomething( lst.get(i) );

In most or all situations, these can be replaced with for each-style iteration. Changing this isn't just for stylistic reasons. It can actually have implications on performance guarantees too. Specifically, there are places in the code base like in com/mwt/explorers/ where you see the following code:

public class BootstrapExplorer<T> implements Explorer<T>, ConsumePolicies<T> {
  private List<Policy<T>> policies;

  public DecisionTuple chooseAction(long saltedSeed, T context) {
    for (int currentBag = 0; currentBag < policies.size(); currentBag++) {
      actionFromBag = policies.get(currentBag).chooseAction(context);  // line 61

The problem is on line 61, actionFromBag = policies.get(currentBag).chooseAction(context). Since there's no random access guarantee at an API level for policies because it's a java.util.List, this loop has a worst case runtime of _O(_P 2) rather than the desired _O(_P) runtime.

By changing standard C-style for loops to for each-style loops, we can make tighten the runtime guarantees while not changing the MWT APIs.

GSON not in pom.xml

I found two issues when trying to compile the project using maven. The first is that GSON is required in com.mwt.tests.BlackBox but is not in the pom.xml file. A second issue that is com.mwt.tests.BlackBox uses java 1.7 classes. To fix these, I would put the com.mwt.tests package in src/test/java and I would update the pom.xml to have the dependencies:



This way, GSON is not a runtime dependency of the library since it's only used in the test code.

Additionally, I'd change com.mwt.tests.BlackBox to import


Then I would remove the java.nio imports and I would change the first line in the try inside the main method to

String content = IOUtils.toString(new File(args[0]).toURI());

This would fix everything and put tests in the proper subdirectory according to maven convention. I'd be happy to submit a pull request if you'd like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.