Codota Logo
Characteristic
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 @XmlRegistry
public class ObjectFactory {

  @XmlElementDecl(name = "characteristic")
  public JAXBElement<String> createCharacteristic(String value) {
    return new Characteristic(value);
  }

}
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: stackoverflow.com

 Characteristic client1 = new Characteristic("Dark Hair", 7);
Characteristic client2 = new Characteristic("Dark Hair", 4);
Characteristic client3 = new Characteristic("Light Hair", 6);
client1.getCompatability(client2); // Returns non-zero compatability since descriptions are the same
client1.getCompatability(client3); // Returns zero compatability since descriptions are different
client2.getCompatability(client3); // Returns zero compatability since descriptions are different
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-workbench-models-guided-scorecard

final Characteristic _characteristic = new Characteristic();
characteristics.getCharacteristics().add(_characteristic);
extension.setName(PMMLExtensionNames.EXTERNAL_CLASS);
extension.setValue(characteristic.getFact());
_characteristic.getExtensions().add(extension);
    throw new IllegalArgumentException("Unknown datatype found: " + characteristic.getDataType() + "!");
_characteristic.getExtensions().add(extension);
_characteristic.setBaselineScore(characteristic.getBaselineScore());
if (model.isUseReasonCodes()) {
  _characteristic.setReasonCode(characteristic.getReasonCode());
_characteristic.setName(characteristic.getName());
  _characteristic.getAttributes().add(_attribute);
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

_characteristic = new Characteristic();
characteristics.getCharacteristics().add(_characteristic);
addExpectation(currentRowCtr + 1, currentColCtr, "name", _characteristic, "Characteristic (Property) Display Name is missing.");
extension.setName( ScorecardPMMLExtensionNames.SCORECARD_CELL_REF);
addExpectation(currentRowCtr + 1, currentColCtr, "value", extension, null);
_characteristic.getExtensions().add(extension);
extension.setName( PMMLExtensionNames.EXTERNAL_CLASS );
addExpectation(currentRowCtr + 1, currentColCtr, "value", extension, null);
_characteristic.getExtensions().add(extension);
_characteristic.getExtensions().add(extension);
addExpectation(currentRowCtr + 1, currentColCtr, "value", extension, "Characteristic (Property) Data Type is missing.");
    _characteristic.getAttributes().add(attribute);
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

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 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

private void validateBaselineScores() {
  for (Object obj :scorecard.getExtensionsAndCharacteristicsAndMiningSchemas()){
    Double scorecardBaseline = scorecard.getBaselineScore();
    if (obj instanceof Characteristics){
      Characteristics characteristics = (Characteristics)obj;
      for (Characteristic characteristic : characteristics.getCharacteristics()){
        Double charBaseline = characteristic.getBaselineScore();
        if  ( (charBaseline == null || charBaseline.doubleValue() == 0)
            && ((scorecardBaseline == null || scorecardBaseline.doubleValue() == 0)) ){
          String newCellRef = createDataTypeCellRef(ScorecardPMMLUtils.getExtensionValue(characteristic.getExtensions(), "cellRef"),2);
          parseErrors.add(new ScorecardError(newCellRef, "Characteristic is missing Baseline Score"));
        }
      }
    }
  }
}
origin: org.drools/drools-scorecards

String characteristicName = ScorecardPMMLUtils.extractFieldNameFromCharacteristic(characteristic);
if (fieldName.equalsIgnoreCase(characteristicName)){
  Extension extension = ScorecardPMMLUtils.getExtension(characteristic.getExtensions(), PMMLExtensionNames.EXTERNAL_CLASS );
  if ( extension != null ) {
    characteristic.getExtensions().remove(extension);
    if ( ScorecardPMMLUtils.getExtension(miningField.getExtensions(), PMMLExtensionNames.EXTERNAL_CLASS ) == null ) {
      miningField.getExtensions().add(extension);
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

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-scorecards

Characteristics characteristics = (Characteristics)obj;
for (Characteristic characteristic : characteristics.getCharacteristics()){
  String dataType = ScorecardPMMLUtils.getExtensionValue(characteristic.getExtensions(), ScorecardPMMLExtensionNames.CHARACTERTISTIC_DATATYPE);
  String newCellRef = createDataTypeCellRef(ScorecardPMMLUtils.getExtensionValue(characteristic.getExtensions(), "cellRef"),1);
  if ( dataType == null || StringUtils.isEmpty(dataType)) {
    parseErrors.add(new ScorecardError(newCellRef, "Missing Data Type!"));
    for (Attribute attribute : characteristic.getAttributes()){
      String value = ScorecardPMMLUtils.getExtensionValue(attribute.getExtensions(), "predicateResolver");
      if (!"TRUE".equalsIgnoreCase(value) && !"FALSE".equalsIgnoreCase(value)){
        parseErrors.add(new ScorecardError(newCellRef, "Characteristic '"+characteristic.getName()+"' is Boolean and can support TRUE|FALSE only"));
        break;
    for (Attribute attribute : characteristic.getAttributes()){
      String value = ScorecardPMMLUtils.getExtensionValue(attribute.getExtensions(), "predicateResolver");
      if (!StringUtil.isNumericWithOperators(value)){
        parseErrors.add(new ScorecardError(newCellRef, "Characteristic '"+characteristic.getName()+"' is Number and can support numerics only"));
origin: org.drools/kie-pmml

/**
 * Create an instance of {@link Characteristic }
 * 
 */
public Characteristic createCharacteristic() {
  return new Characteristic();
}
origin: org.drools/drools-scorecards

Extension dataTypeExtension = ScorecardPMMLUtils.getExtension(characteristic.getExtensions(), ScorecardPMMLExtensionNames.CHARACTERTISTIC_DATATYPE);
String dataType = dataTypeExtension.getValue();
String factType = ScorecardPMMLUtils.getExtensionValue(characteristic.getExtensions(), ScorecardPMMLExtensionNames.CHARACTERTISTIC_FACTTYPE);
for (Attribute attribute : characteristic.getAttributes()) {
  for (Extension extension : attribute.getExtensions()) {
    if ( ScorecardPMMLExtensionNames.CHARACTERTISTIC_FIELD.equalsIgnoreCase(extension.getName())) {
characteristic.getExtensions().remove(dataTypeExtension);
ctr++;
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: stackoverflow.com

Characteristic c1 = new Characteristic("Description"); // Using constructor with one String.
origin: stackoverflow.com

 @Test
public void marshallsDynamicElementName() throws JAXBException {
  JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
  final Characteristics characteristics = new Characteristics();
  final Characteristic characteristic = new Characteristic(
      "store_capacity", "40");
  characteristics.getCharacteristics().add(characteristic);
  context.createMarshaller().marshal(characteristics, System.out);
}
org.dmg.pmml.pmml_4_2.descrCharacteristic

Javadoc

Java class for anonymous complex type.

The following schema fragment specifies the expected content contained within this class.

 
<complexType> 
<complexContent> 
<restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 
<sequence> 
<element ref="{http://www.dmg.org/PMML-4_2}Extension" maxOccurs="unbounded" minOccurs="0"/> 
<element ref="{http://www.dmg.org/PMML-4_2}Attribute" maxOccurs="unbounded"/> 
</sequence> 
<attribute name="name" type="{http://www.dmg.org/PMML-4_2}FIELD-NAME" /> 
<attribute name="reasonCode" type="{http://www.w3.org/2001/XMLSchema}string" /> 
<attribute name="baselineScore" type="{http://www.dmg.org/PMML-4_2}NUMBER" /> 
</restriction> 
</complexContent> 
</complexType> 

Most used methods

  • <init>
  • getAttributes
    Gets the value of the attributes property. This accessor method returns a reference to the live list
  • 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

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now