congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Characteristic.getAttributes
Code IndexAdd Tabnine to your IDE (free)

How to use
getAttributes
method
in
org.dmg.pmml.pmml_4_2.descr.Characteristic

Best Java code snippets using org.dmg.pmml.pmml_4_2.descr.Characteristic.getAttributes (Showing top 13 results out of 315)

origin: org.drools/kie-pmml

public ComplexScore(Characteristic charac, Attribute attrib) {
  this.characteristicName = charac.getName();
  this.attributeIndex = charac.getAttributes().indexOf(attrib);
  this.complexScore = helper.createPartialScoreFormula(attrib);
  this.fldNames = new ArrayList<>();
  createListOfFieldNames(attrib);
}
origin: org.drools/drools-scorecards

private void checkForMissingAttributes() {
  for (Object obj :scorecard.getExtensionsAndCharacteristicsAndMiningSchemas()){
    if (obj instanceof Characteristics){
      Characteristics characteristics = (Characteristics)obj;
      for (Characteristic characteristic : characteristics.getCharacteristics()){
        String newCellRef = ScorecardPMMLUtils.getExtensionValue(characteristic.getExtensions(), "cellRef");
        if ( characteristic.getAttributes().size() == 0 ) {
          parseErrors.add(new ScorecardError(newCellRef, "Missing Attribute Bins for Characteristic '"+characteristic.getName()+"'."));
        }
      }
    }
  }
}
origin: org.drools/drools-scorecards

private void removeAttributeFieldExtension(Scorecard pmmlScorecard) {
  for (Object obj : pmmlScorecard.getExtensionsAndCharacteristicsAndMiningSchemas()) {
    if (obj instanceof Characteristics) {
      Characteristics characteristics = (Characteristics) obj;
      for (org.dmg.pmml.pmml_4_2.descr.Characteristic characteristic : characteristics.getCharacteristics()) {
        for (Attribute attribute : characteristic.getAttributes()) {
          Extension fieldExtension = ScorecardPMMLUtils.getExtension(attribute.getExtensions(), ScorecardPMMLExtensionNames.CHARACTERTISTIC_FIELD);
          if ( fieldExtension != null ) {
            attribute.getExtensions().remove(fieldExtension);
            //break;
          }
        }
      }
    }
  }
}
origin: org.drools/drools-scorecards

private void removeEmptyExtensions(Scorecard pmmlScorecard) {
  for (Object obj : pmmlScorecard.getExtensionsAndCharacteristicsAndMiningSchemas()) {
    if (obj instanceof Characteristics) {
      Characteristics characteristics = (Characteristics) obj;
      for (org.dmg.pmml.pmml_4_2.descr.Characteristic characteristic : characteristics.getCharacteristics()) {
        List<Extension> toRemoveExtensionsList = new ArrayList<Extension>();
        for (Extension extension : characteristic.getExtensions()) {
          if (StringUtils.isEmpty(extension.getValue())) {
            toRemoveExtensionsList.add(extension);
          }
        }
        for (Extension extension : toRemoveExtensionsList) {
          characteristic.getExtensions().remove(extension);
        }
        for (Attribute attribute : characteristic.getAttributes()) {
          List<Extension> toRemoveExtensionsList2 = new ArrayList<Extension>();
          for (Extension extension : attribute.getExtensions()) {
            if (StringUtils.isEmpty(extension.getValue())) {
              toRemoveExtensionsList2.add(extension);
            }
          }
          for (Extension extension : toRemoveExtensionsList2) {
            attribute.getExtensions().remove(extension);
          }
        }
      }
    }
  }
}
origin: org.drools/drools-scorecards

for (Attribute attribute : characteristic.getAttributes()){
  String value = ScorecardPMMLUtils.getExtensionValue(attribute.getExtensions(), "predicateResolver");
  if (!"TRUE".equalsIgnoreCase(value) && !"FALSE".equalsIgnoreCase(value)){
for (Attribute attribute : characteristic.getAttributes()){
  String value = ScorecardPMMLUtils.getExtensionValue(attribute.getExtensions(), "predicateResolver");
  if (!StringUtil.isNumericWithOperators(value)){
origin: org.drools/drools-scorecards

public static String extractFieldNameFromCharacteristic(Characteristic c) {
  String field = "";
  Attribute scoreAttribute = c.getAttributes().get(0);
  if (scoreAttribute.getSimplePredicate() != null) {
    field = scoreAttribute.getSimplePredicate().getField();
  } else if (scoreAttribute.getSimpleSetPredicate() != null) {
    field = scoreAttribute.getSimpleSetPredicate().getField();
  } else if (scoreAttribute.getCompoundPredicate() != null) {
    Object predicate = scoreAttribute.getCompoundPredicate().getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().get(0);
    if (predicate instanceof SimplePredicate){
      field = ((SimplePredicate)predicate).getField();
    } else if (predicate instanceof SimpleSetPredicate){
      field = ((SimpleSetPredicate)predicate).getField();
    }
  }
  return field;
}
origin: org.drools/drools-workbench-models-guided-scorecard

  private void checkCharacteristics(PMML pmml) {
    if (pmml != null
        && pmml.getAssociationModelsAndBaselineModelsAndClusteringModels() != null
        && !pmml.getAssociationModelsAndBaselineModelsAndClusteringModels().isEmpty()) {
      for (Serializable s : pmml.getAssociationModelsAndBaselineModelsAndClusteringModels()) {
        if (s instanceof Scorecard) {
          Scorecard scard = (Scorecard) s;
          if (scard.getExtensionsAndCharacteristicsAndMiningSchemas() != null
              && !scard.getExtensionsAndCharacteristicsAndMiningSchemas().isEmpty()) {
            for (Serializable sz : scard.getExtensionsAndCharacteristicsAndMiningSchemas()) {
              if (sz instanceof Characteristics) {
                Characteristics characteristics = (Characteristics) sz;
                if (characteristics.getCharacteristics() == null
                    || characteristics.getCharacteristics().isEmpty()) {
                  Characteristic ch = new Characteristic();
                  ch.setBaselineScore(0.0);
                  ch.setName("placeholder");
                  Attribute attr = new Attribute();
                  attr.setFalse(new False());
                  ch.getAttributes().add(attr);
                  characteristics.getCharacteristics().add(ch);
                }
              }
            }
          }
        }
      }
    }
  }
}
origin: org.drools/drools-scorecards

private void validateWeights() {
  for (Object obj :scorecard.getExtensionsAndCharacteristicsAndMiningSchemas()){
    if (obj instanceof Characteristics){
      Characteristics characteristics = (Characteristics)obj;
      for (Characteristic characteristic : characteristics.getCharacteristics()){
        for (Attribute attribute : characteristic.getAttributes()){
          String newCellRef = createDataTypeCellRef(ScorecardPMMLUtils.getExtensionValue(attribute.getExtensions(), "cellRef"),2);
          String weight = ScorecardPMMLUtils.getExtensionValue(attribute.getExtensions(), ScorecardPMMLExtensionNames.CHARACTERTISTIC_WEIGHT);
          if ( StringUtils.isEmpty(weight) || !isDouble(weight)){
            parseErrors.add(new ScorecardError(newCellRef, "Attribute is missing weight or specified weight is not a double."));
          }
        }
      }
    }
  }
}
origin: org.drools/drools-scorecards

private void createAndSetPredicates(Scorecard pmmlScorecard) {
  for (Object obj : pmmlScorecard.getExtensionsAndCharacteristicsAndMiningSchemas()) {
    if (obj instanceof Characteristics) {
      Characteristics characteristics = (Characteristics) obj;
      for (org.dmg.pmml.pmml_4_2.descr.Characteristic characteristic : characteristics.getCharacteristics()) {
        String dataType = ScorecardPMMLUtils.getExtensionValue(characteristic.getExtensions(), ScorecardPMMLExtensionNames.CHARACTERTISTIC_DATATYPE);
        Extension predicateExtension = null;
        for (Attribute attribute : characteristic.getAttributes()) {
          String predicateAsString = "";
          String field = ScorecardPMMLUtils.getExtensionValue(attribute.getExtensions(), ScorecardPMMLExtensionNames.CHARACTERTISTIC_FIELD);
          for (Extension extension : attribute.getExtensions()) {
            if ("predicateResolver".equalsIgnoreCase(extension.getName())) {
              predicateAsString = extension.getValue();
              predicateExtension = extension;
              break;
            }
          }
          setPredicatesForAttribute(attribute, dataType, field, predicateAsString);
          attribute.getExtensions().remove(predicateExtension);
        }
      }
    }
  }
}
origin: org.drools/drools-scorecards

private void validateReasonCodes() {
  for (Object obj :scorecard.getExtensionsAndCharacteristicsAndMiningSchemas()){
    if (obj instanceof Characteristics){
      Characteristics characteristics = (Characteristics)obj;
      for (Characteristic characteristic : characteristics.getCharacteristics()){
        String charReasonCode = characteristic.getReasonCode();
        if (charReasonCode == null || StringUtils.isEmpty(charReasonCode)){
          for (Attribute attribute : characteristic.getAttributes()){
            String newCellRef = createDataTypeCellRef(ScorecardPMMLUtils.getExtensionValue(attribute.getExtensions(), "cellRef"),3);
            String attrReasonCode = attribute.getReasonCode();
            if ( attrReasonCode == null || StringUtils.isEmpty(attrReasonCode)){
              parseErrors.add(new ScorecardError(newCellRef, "Attribute is missing Reason Code"));
            }
          }
        }
      }
    }
  }
}
origin: org.drools/drools-scorecards

for (Attribute attribute : characteristic.getAttributes()) {
  for (Extension extension : attribute.getExtensions()) {
    if ( ScorecardPMMLExtensionNames.CHARACTERTISTIC_FIELD.equalsIgnoreCase(extension.getName())) {
origin: org.drools/drools-scorecards

_characteristic.getAttributes().add(attribute);
origin: org.drools/drools-workbench-models-guided-scorecard

_characteristic.getAttributes().add(_attribute);
org.dmg.pmml.pmml_4_2.descrCharacteristicgetAttributes

Javadoc

Gets the value of the attributes property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the attributes property.

For example, to add a new item, do as follows:

 
getAttributes().add(newItem); 

Objects of the following type(s) are allowed in the list Attribute

Popular methods of Characteristic

  • <init>
  • getExtensions
    Gets the value of the extensions property. This accessor method returns a reference to the live list
  • getName
    Gets the value of the name property.
  • getBaselineScore
    Gets the value of the baselineScore property.
  • getCompatability
  • getReasonCode
    Gets the value of the reasonCode property.
  • setBaselineScore
    Sets the value of the baselineScore property.
  • setName
    Sets the value of the name property.
  • setReasonCode
    Sets the value of the reasonCode property.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • JFileChooser (javax.swing)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now