Package org.dmg.pmml._40

Examples of org.dmg.pmml._40.AssociationModelType


   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetArray(ArrayType newArray, NotificationChain msgs) {
    ArrayType oldArray = array;
    array = newArray;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.SET_PREDICATE_TYPE__ARRAY, oldArray, newArray);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here


   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetArray(ArrayType newArray, NotificationChain msgs) {
    ArrayType oldArray = array;
    array = newArray;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.MISSING_VALUE_WEIGHTS_TYPE__ARRAY, oldArray, newArray);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetArray(ArrayType newArray, NotificationChain msgs) {
    ArrayType oldArray = array;
    array = newArray;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.CLASS_LABELS_TYPE__ARRAY, oldArray, newArray);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetArray(ArrayType newArray, NotificationChain msgs) {
    ArrayType oldArray = array;
    array = newArray;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.TIME_CYCLE_TYPE__ARRAY, oldArray, newArray);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

    HeaderType header = _40Factory.eINSTANCE.createHeaderType();
    header.setCopyright("www.admire-project.eu");
    header.setDescription("Association rule model");
    pmml.setHeader(header);
       
        AssociationModelType ruleModel = _40Factory.eINSTANCE.createAssociationModelType();
        pmml.getAssociationModel().add(ruleModel);

      
        List<AssociationRule> rules = associator.getAssociationRules().getRules();

        ruleModel.setNumberOfRules(BigInteger.valueOf(rules.size()));
       
        List<MyItemSet> allItemsets = new ArrayList<MyItemSet>();
        for(AssociationRule r:rules) {
          MyItemSet myPremise = new MyItemSet(r.getPremiseSupport(), r.getPremise());
          MyItemSet myConsequence = new MyItemSet(r.getConsequenceSupport(), r.getConsequence());
          if(!allItemsets.contains(myPremise))
            allItemsets.add(myPremise);
         
          if(!allItemsets.contains(myConsequence))
            allItemsets.add(myConsequence);
         
          AssociationRuleType ruleType = _40Factory.eINSTANCE.createAssociationRuleType();
          ruleType.setAntecedent(String.valueOf(allItemsets.indexOf(myPremise)));
          ruleType.setConsequent(String.valueOf(allItemsets.indexOf(myConsequence)));
          try {
           
            //ruleType.setSupport(BigDecimal.valueOf(r.getTotalSupport()));
            ruleType.setSupport(BigDecimal.valueOf(Math.random()));
            ruleType.setConfidence(BigDecimal.valueOf(r.getNamedMetricValue("Confidence")));
            ruleType.setLift(BigDecimal.valueOf(r.getNamedMetricValue("Lift")).floatValue());
           
          }
          catch(Exception exc) {
            exc.printStackTrace();
          }
          ruleModel.getAssociationRule().add(ruleType);
        
        }
       
        List<Item> allItems = new ArrayList<Item>();
        LOG.debug("AllItemSetsSize == " + allItemsets.size());
        for(MyItemSet itemset:allItemsets) {
         
          List<ItemRefType> itemrefs = new ArrayList<ItemRefType>();
          for(Item i:itemset.getItems()) {
            if(!allItems.contains(i)) {           
              allItems.add(i);
              ItemType pmmlItem = _40Factory.eINSTANCE.createItemType();
              pmmlItem.setId(String.valueOf(allItems.indexOf(i)));
              pmmlItem.setValue(i.toString());
              ruleModel.getItem().add(pmmlItem);

            }
          ItemRefType itemref = _40Factory.eINSTANCE.createItemRefType();
          itemref.setItemRef(String.valueOf(allItems.indexOf(i)));
          itemrefs.add(itemref);
          }
          ItemsetType pmmlItemset = _40Factory.eINSTANCE.createItemsetType();
          pmmlItemset.setId(String.valueOf(allItemsets.indexOf(itemset)));
          pmmlItemset.setSupport(BigDecimal.valueOf(itemset.getSupport()));
          pmmlItemset.setNumberOfItems(BigInteger.valueOf(itemset.getItems().size()));
          pmmlItemset.getItemRef().addAll(itemrefs);
          ruleModel.getItemset().add(pmmlItemset);
          ruleModel.setNumberOfItems(BigInteger.valueOf(allItems.size()));
          ruleModel.setNumberOfItemsets(BigInteger.valueOf(allItemsets.size()));
          if(rules.size() > 0)
            ruleModel.setNumberOfTransactions(BigInteger.valueOf(rules.get(0).getTotalTransactions()));
          if(associator instanceof OptionHandler) {
           
            String[] options = ((OptionHandler)associator).getOptions();
            ruleModel.setMinimumConfidence(BigDecimal.valueOf(getMinConfidence(options)));
            ruleModel.setMinimumSupport(BigDecimal.valueOf(getMinSupport(options)));
          }

        }
       
       
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetBinarySimilarity(BinarySimilarityType newBinarySimilarity, NotificationChain msgs) {
    BinarySimilarityType oldBinarySimilarity = binarySimilarity;
    binarySimilarity = newBinarySimilarity;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.COMPARISON_MEASURE_TYPE__BINARY_SIMILARITY, oldBinarySimilarity, newBinarySimilarity);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetBoundaryValues(BoundaryValuesType newBoundaryValues, NotificationChain msgs) {
    BoundaryValuesType oldBoundaryValues = boundaryValues;
    boundaryValues = newBoundaryValues;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, _40Package.ROC_GRAPH_TYPE__BOUNDARY_VALUES, oldBoundaryValues, newBoundaryValues);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setCompareFunction(COMPAREFUNCTION newCompareFunction) {
    COMPAREFUNCTION oldCompareFunction = compareFunction;
    compareFunction = newCompareFunction == null ? COMPARE_FUNCTION_EDEFAULT : newCompareFunction;
    boolean oldCompareFunctionESet = compareFunctionESet;
    compareFunctionESet = true;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, _40Package.COMPARISON_MEASURE_TYPE__COMPARE_FUNCTION, oldCompareFunction, compareFunction, !oldCompareFunctionESet));
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void unsetCompareFunction() {
    COMPAREFUNCTION oldCompareFunction = compareFunction;
    boolean oldCompareFunctionESet = compareFunctionESet;
    compareFunction = COMPARE_FUNCTION_EDEFAULT;
    compareFunctionESet = false;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.UNSET, _40Package.COMPARISON_MEASURE_TYPE__COMPARE_FUNCTION, oldCompareFunction, COMPARE_FUNCTION_EDEFAULT, oldCompareFunctionESet));
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setCompareFunction(COMPAREFUNCTION newCompareFunction) {
    COMPAREFUNCTION oldCompareFunction = compareFunction;
    compareFunction = newCompareFunction == null ? COMPARE_FUNCTION_EDEFAULT : newCompareFunction;
    boolean oldCompareFunctionESet = compareFunctionESet;
    compareFunctionESet = true;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, _40Package.CLUSTERING_FIELD_TYPE__COMPARE_FUNCTION, oldCompareFunction, compareFunction, !oldCompareFunctionESet));
View Full Code Here

TOP

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

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.