Package org.dmg.pmml

Examples of org.dmg.pmml.DataField


    // Do PreProcessing on Parameters
    if(this.preProcessor != null && !this.preProcessor.isEmpty())
      processor.doScriptProcessing(this.preProcessor, parameters);
   
    for(FieldName activeField : activeFields){
      DataField dataField = this.evaluator.getDataField(activeField);
      Object value = parameters.get(dataField.getName().getValue());
     
      if(value == null || value.toString().isEmpty()) {
          result.addError("No parameter found for: " + dataField.getName());
          log.log(Level.WARNING, "No parameter found for: " + dataField.getName());
      } else {
          try {
        arguments.put(activeField, evaluator.prepare(activeField, value));
          } catch (Exception e) {
        result.addError("Field " + activeField.getValue() + " has invalid value " + value);
        log.log(Level.SEVERE, e.getMessage());
        result.setValid(false);
        return result;
          }
      }
 
    }
   
    try {
        pmmlResult = evaluator.evaluate(arguments);
    } catch (Exception e) {
        result.addError("Unable to evaluate model: " + e.getMessage());
        log.log(Level.WARNING, "Unable to evaluate model: " + e.getMessage());
        return result;
    }
   
    List<FieldName> predictedFields = evaluator.getPredictedFields();
    for(FieldName predictedField : predictedFields){
      DataField dataField = evaluator.getDataField(predictedField);
      Object predictedValue = pmmlResult.get(predictedField);
      result.addPredictedValue(dataField.getName().getValue(), predictedValue);
    }
 
    List<FieldName> resultFields = this.evaluator.getOutputFields();
    for(FieldName resultField : resultFields){
      OutputField outputField = evaluator.getOutputField(resultField);
View Full Code Here


    Map<String, String> result = new HashMap<String, String>();
   
    List<FieldName> activeFields = evaluator.getActiveFields();
   
    for(FieldName activeField : activeFields) {
        DataField dataField = evaluator.getDataField(activeField);
        result.put(dataField.getName().getValue(), dataField.getDataType().name());
    }
   
    return result;
    }
View Full Code Here

    {
    ModelSchema modelSchema = new ModelSchema();

    for( MiningField miningField : model.getMiningSchema().getMiningFields() )
      {
      DataField dataField = getPMMLModel().getDataField( miningField.getName() );

      if( miningField.getUsageType() == FieldUsageType.ACTIVE )
        modelSchema.addExpectedField( createDataFields( dataField ) );
      else if( miningField.getUsageType() == FieldUsageType.PREDICTED )
        modelSchema.setPredictedFields( createDataFields( dataField ) );
View Full Code Here

      for( MiningField miningField : model.getMiningSchema().getMiningFields() )
        {
        if( miningField.getUsageType() != usageType )
          continue;

        DataField dataField = getDataField( miningField.getName() );

        fields.put( miningField.getName().getValue(), DataTypes.getPmmlToType( dataField.getDataType() ) );
        }
      }

    Fields results = Fields.NONE;
View Full Code Here

    return addDataField( name, null, opType, dataType );
    }

  public DataField addDataField( FieldName name, String displayName, OpType opType, DataType dataType )
    {
    DataField dataField = new DataField( name, opType, dataType );
    dataField.setDisplayName( displayName );

    List<DataField> dataFields = pmml.getDataDictionary().getDataFields();
    dataFields.add( dataField );

    return dataField;
View Full Code Here

TOP

Related Classes of org.dmg.pmml.DataField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.