Examples of CategoricalDataField


Examples of cascading.pattern.datafield.CategoricalDataField

    {
    DataType dataType = dataField.getDataType();
    Type type = DataTypes.getPmmlToType( dataType );

    if( type == String.class )
      return new CategoricalDataField( name, type, asStrings( dataField.getValues() ) );

    String message = String.format( "unsupported data type: %s", dataType );
    LOG.error( message );

    throw new PatternException( message );
View Full Code Here

Examples of cascading.pattern.datafield.CategoricalDataField

      throw new IllegalArgumentException( "predicted field does not exist: " + fieldName );

    DataField dataField = dictionary.get( fieldName );

    if( dataField instanceof ContinuousDataField )
      dataField = new CategoricalDataField( fieldName, String.class, categories );
    else
      dataField = new CategoricalDataField( (CategoricalDataField) dataField, categories );

    dictionary.put( fieldName, dataField );
    }
View Full Code Here

Examples of cascading.pattern.datafield.CategoricalDataField

    for( Comparable field : fields )
      {
      if( field instanceof Number )
        throw new IllegalArgumentException( "all fields must be names, not ordinal, got: " + field );

      dataFields.add( new CategoricalDataField( (String) field, fields.getType( field ), categories[ fields.getPos( field ) ] ) );
      }

    return dataFields;
    }
View Full Code Here

Examples of pattern.datafield.CategoricalDataField

          .getAttribute("coefficient"));
      pred = new NumericPredictor(name, coefficient, exponent);
    } else if ("CategoricalPredictor".equals(node.getNodeName())) {
      // <CategoricalPredictor name="species" value="setosa"
      // coefficient="0"/>
      CategoricalDataField df = (CategoricalDataField) schema.get(name);
      Integer value = df.categories.indexOf(node.getAttribute("value"));
      Double coefficient = Double.valueOf(node
          .getAttribute("coefficient"));
      pred = new CategoricalPredictor(name, coefficient, value);
    } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.