Package org.dmg.pmml._40

Examples of org.dmg.pmml._40.DataDictionaryType


    HeaderType header = _40Factory.eINSTANCE.createHeaderType();
    header.setCopyright("www.admire-project.eu");
    header.setDescription("Radial Coordinate visualization");
    pmml.setHeader(header);

    DataDictionaryType dataDictionary = _40Factory.eINSTANCE
        .createDataDictionaryType();
    dataDictionary.setNumberOfFields(BigInteger.valueOf(data
        .numAttributes()));
    pmml.setDataDictionary(dataDictionary);

    // Create anchors S around circle
    bodyS = new double[data.numAttributes() - 1][2];
    double k = 2 * Math.PI / (data.numAttributes() - 1);
    // Add DataDictionary
    Enumeration enumerAttributes = data.enumerateAttributes();
    while (enumerAttributes.hasMoreElements()) {
      Attribute attr = (Attribute) enumerAttributes.nextElement();
      DataFieldType dataField = _40Factory.eINSTANCE
          .createDataFieldType();
      dataField.setDataType(DATATYPE.DOUBLE); // DATATYPE
      dataField.setName(attr.name()); // String
      dataField.setOptype(OPTYPE.CONTINUOUS); // OPTYPE
      String[] strCoordinates = null;
      strCoordinates = createAnchors(attr.index(), k);
      // Add Extension - Coordinate X
      ExtensionType extension = _40Factory.eINSTANCE
          .createExtensionType();
      extension.setName("xCoordinate");
      extension.setValue(strCoordinates[0]);
      dataField.getExtension().add(extension);
      // Add Extension - Coordinate y
      extension = _40Factory.eINSTANCE.createExtensionType();
      extension.setName("yCoordinate");
      extension.setValue(strCoordinates[1]);
      dataField.getExtension().add(extension);
      dataDictionary.getDataField().add(dataField);
    }
    DataFieldType dataField = _40Factory.eINSTANCE.createDataFieldType();
    dataField.setDataType(DATATYPE.STRING); // DATATYPE
    dataField.setName("class"); // String
    dataField.setOptype(OPTYPE.CATEGORICAL); // OPTYPE
    dataDictionary.getDataField().add(dataField);
    Attribute classAttr = data.classAttribute();
    Enumeration values = classAttr.enumerateValues();

    while (values.hasMoreElements()) {
      ValueType valueType = _40Factory.eINSTANCE.createValueType();
      valueType.setValue(values.nextElement().toString());
      dataField.getValue().add(valueType);
    }

    Enumeration<?> helpInstances = data.enumerateInstances();
    while (helpInstances.hasMoreElements()) {
      Instance instance = (Instance) helpInstances.nextElement();
      setMinAndMaxOfAttributes(instance);
    }

    Enumeration<?> instances = data.enumerateInstances();
    while (instances.hasMoreElements()) {
      Instance instance = (Instance) instances.nextElement();
      createPointsU(instance);
    }

    ExtensionType extension = null;
    for (String[] helpBody : bodyU) {
      String helpString = "";
      helpString = helpBody[0] + " " + helpBody[1] + " " + helpBody[2];
      extension = _40Factory.eINSTANCE.createExtensionType();
      extension.setName(Integer.toString(bodyU.indexOf(helpBody) + 1));
      FeatureMapUtil.addText(extension.getMixed(), helpString);
      dataDictionary.getExtension().add(extension);
    }

    resource.getContents().add(documentRoot);
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    try {
View Full Code Here


          MiningFieldType miningField =  _40Factory.eINSTANCE.createMiningFieldType();
          miningField.setName(helpBox[0])//String
          miningSchema.getMiningField().add(miningField);
        }
       
        DataDictionaryType dataDictionary = _40Factory.eINSTANCE.createDataDictionaryType();
        dataDictionary.setNumberOfFields(BigInteger.valueOf(attributesArry.size()));
        pmml.setDataDictionary(dataDictionary);
        for (int i=0; i<attributesArry.size(); i++) {
      String [] helpBox = attributesArry.get(i);
            DataFieldType dataFieldType = _40Factory.eINSTANCE.createDataFieldType();
            dataFieldType.setDataType(associateDatatype(helpBox[2]))//DATATYPE
            dataFieldType.setName(helpBox[0])//String
            dataFieldType.setOptype(associateOptype(helpBox[1]))//OPTYPE
            if (dataFieldType.getOptype().equals(OPTYPE.CATEGORICAL)) {
              for (int j=3; j<helpBox.length; j++) {
                ValueType valueType = _40Factory.eINSTANCE.createValueType();
                valueType.setValue(helpBox[j]);
                dataFieldType.getValue().add(valueType);
              }
            }
            dataDictionary.getDataField().add(dataFieldType);
        }
   
   
    resource.getContents().add(documentRoot);
    ByteArrayOutputStream os = new ByteArrayOutputStream();
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetDecisionTree(DecisionTreeType newDecisionTree, NotificationChain msgs) {
    DecisionTreeType oldDecisionTree = decisionTree;
    decisionTree = newDecisionTree;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.NODE_TYPE__DECISION_TREE, oldDecisionTree, newDecisionTree);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetDerivedField(DerivedFieldType newDerivedField, NotificationChain msgs) {
    DerivedFieldType oldDerivedField = derivedField;
    derivedField = newDerivedField;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.NEURAL_OUTPUT_TYPE__DERIVED_FIELD, oldDerivedField, newDerivedField);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetDerivedField(DerivedFieldType newDerivedField, NotificationChain msgs) {
    DerivedFieldType oldDerivedField = derivedField;
    derivedField = newDerivedField;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.BAYES_INPUT_TYPE__DERIVED_FIELD, oldDerivedField, newDerivedField);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetEuclidean(EuclideanType newEuclidean, NotificationChain msgs) {
    EuclideanType oldEuclidean = euclidean;
    euclidean = newEuclidean;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.COMPARISON_MEASURE_TYPE__EUCLIDEAN, oldEuclidean, newEuclidean);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetExtension1(ExtensionType newExtension1, NotificationChain msgs) {
    ExtensionType oldExtension1 = extension1;
    extension1 = newExtension1;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.SEGMENT_TYPE__EXTENSION1, oldExtension1, newExtension1);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetFalse(FalseType newFalse, NotificationChain msgs) {
    FalseType oldFalse = false_;
    false_ = newFalse;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.NODE_TYPE__FALSE, oldFalse, newFalse);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetFalse(FalseType newFalse, NotificationChain msgs) {
    FalseType oldFalse = false_;
    false_ = newFalse;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.SEGMENT_TYPE__FALSE, oldFalse, newFalse);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetFalse(FalseType newFalse, NotificationChain msgs) {
    FalseType oldFalse = false_;
    false_ = newFalse;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.COMPOUND_RULE_TYPE__FALSE, oldFalse, newFalse);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

TOP

Related Classes of org.dmg.pmml._40.DataDictionaryType

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.