org.dmg.pmml.Value.getValue()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.dmg.pmml.Value.getValue()方法的一些代码示例,展示了Value.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.getValue()方法的具体详情如下:
包路径:org.dmg.pmml.Value
类名称:Value
方法名:getValue

Value.getValue介绍

暂无

代码示例

代码示例来源:origin: OryxProject/oryx

@Test
public void testBuildDataDictionary() {
 Map<Integer,Collection<String>> distinctValues = new HashMap<>();
 distinctValues.put(1, Arrays.asList("one", "two", "three", "four", "five"));
 CategoricalValueEncodings categoricalValueEncodings =
   new CategoricalValueEncodings(distinctValues);
 DataDictionary dictionary =
   AppPMMLUtils.buildDataDictionary(buildTestSchema(), categoricalValueEncodings);
 assertEquals(4, dictionary.getNumberOfFields().intValue());
 checkDataField(dictionary.getDataFields().get(0), "foo", null);
 checkDataField(dictionary.getDataFields().get(1), "bar", true);
 checkDataField(dictionary.getDataFields().get(2), "baz", null);
 checkDataField(dictionary.getDataFields().get(3), "bing", false);
 List<Value> dfValues = dictionary.getDataFields().get(1).getValues();
 assertEquals(5, dfValues.size());
 String[] categoricalValues = { "one", "two", "three", "four", "five" };
 for (int i = 0; i < categoricalValues.length; i++) {
  assertEquals(categoricalValues[i], dfValues.get(i).getValue());
 }
}

代码示例来源:origin: org.jpmml/pmml-model

@Override
public String getKey() {
  return getValue();
}

代码示例来源:origin: jpmml/jpmml-model

@Override
public String getKey() {
  return getValue();
}

代码示例来源:origin: jpmml/jpmml-sklearn

@Override
  public VisitorAction visit(Value pmmlValue){
    Object value = values.get(pmmlValue.getValue());
    if(value != null){
      value = ScalarUtil.decode(value);
      addExtension(pmmlValue, ValueUtil.formatValue(value));
    }
    return super.visit(pmmlValue);
  }
};

代码示例来源:origin: jpmml/jpmml-evaluator

static
private List<String> parseCategories(DataField dataField){
  List<String> result = new ArrayList<>();
  if(dataField.hasValues()){
    List<Value> pmmlValues = dataField.getValues();
    for(Value pmmlValue : pmmlValues){
      String stringValue = pmmlValue.getValue();
      if(stringValue == null){
        throw new MissingAttributeException(pmmlValue, PMMLAttributes.VALUE_VALUE);
      }
      Value.Property property = pmmlValue.getProperty();
      switch(property){
        case VALID:
          result.add(stringValue);
          break;
        default:
          break;
      }
    }
  }
  return result;
}

代码示例来源:origin: org.jpmml/pmml-extension

private Map<FieldValue, Value> parseValues(DataType dataType, OpType opType){
    Map<FieldValue, Value> result = new LinkedHashMap<>();

    List<Value> fieldValues = getValues();
    for(Value fieldValue : fieldValues){
      Value.Property property = fieldValue.getProperty();

      switch(property){
        case VALID:
          {
            FieldValue value = FieldValueUtil.create(dataType, opType, fieldValue.getValue());

            result.put(value, fieldValue);
          }
          break;
        case INVALID:
        case MISSING:
          break;
        default:
          throw new UnsupportedFeatureException(fieldValue, property);
      }
    }

    return result;
  }
}

代码示例来源:origin: jpmml/jpmml-evaluator

String stringValue = pmmlValue.getValue();
if(stringValue == null){
  throw new MissingAttributeException(pmmlValue, PMMLAttributes.VALUE_VALUE);

代码示例来源:origin: org.jpmml/pmml-evaluator-extension

String stringValue = pmmlValue.getValue();
if(stringValue == null){
  throw new MissingAttributeException(pmmlValue, PMMLAttributes.VALUE_VALUE);

代码示例来源:origin: jpmml/jpmml-evaluator

static
private <F extends Field<F> & HasDiscreteDomain<F>> List<Object> parseValidValues(F field){
  List<Object> result = new ArrayList<>();
  DataType dataType = field.getDataType();
  if(dataType == null){
    throw new MissingAttributeException(MissingAttributeException.formatMessage(XPathUtil.formatElement(field.getClass()) + "@dataType"), field);
  } // End if
  if(field.hasValues()){
    List<Value> pmmlValues = field.getValues();
    for(Value pmmlValue : pmmlValues){
      String stringValue = pmmlValue.getValue();
      if(stringValue == null){
        throw new MissingAttributeException(pmmlValue, PMMLAttributes.VALUE_VALUE);
      }
      Value.Property property = pmmlValue.getProperty();
      switch(property){
        case VALID:
          result.add(TypeUtil.parse(dataType, stringValue));
          break;
        default:
          break;
      }
    }
  }
  return result;
}

代码示例来源:origin: jpmml/jpmml-evaluator

Value pmmlValue = pmmlValues.get(i);
String stringValue = pmmlValue.getValue();
if(stringValue == null){
  throw new MissingAttributeException(pmmlValue, PMMLAttributes.VALUE_VALUE);

代码示例来源:origin: jpmml/jpmml-evaluator

Value pmmlValue = pmmlValues.get(i);
String stringValue = pmmlValue.getValue();
if(stringValue == null){
  throw new MissingAttributeException(pmmlValue, PMMLAttributes.VALUE_VALUE);

相关文章

微信公众号

最新文章

更多