code: public static TableFactorBuilder fromMap(VariableNumMap variables,
        Map<Assignment, Double> probabilities) {
      TableFactorBuilder builder = new TableFactorBuilder(variables);
      for (Map.Entry<Assignment, Double> outcome : probabilities.entrySet()) {
        builder.setWeight(outcome.getKey(), outcome.getValue());
      }
      return builder;
    }
docs: Gets a {@code TableFactorBuilder} containing the same assignments and
  weights as {@code probabilities}.
  
  @param variables
  @param probabilities
  @return