org.dmg.pmml.OutputField Maven / Gradle / Ivy
package org.dmg.pmml;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.sun.xml.bind.Locatable;
import com.sun.xml.bind.annotation.XmlLocation;
import org.jpmml.schema.Added;
import org.jpmml.schema.Deprecated;
import org.jpmml.schema.Version;
import org.xml.sax.Locator;
/**
* 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"/>
* <sequence minOccurs="0">
* <element ref="{http://www.dmg.org/PMML-4_2}Decisions" minOccurs="0"/>
* <group ref="{http://www.dmg.org/PMML-4_2}EXPRESSION"/>
* </sequence>
* </sequence>
* <attribute name="name" use="required" type="{http://www.dmg.org/PMML-4_2}FIELD-NAME" />
* <attribute name="displayName" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="optype" type="{http://www.dmg.org/PMML-4_2}OPTYPE" />
* <attribute name="dataType" type="{http://www.dmg.org/PMML-4_2}DATATYPE" />
* <attribute name="targetField" type="{http://www.dmg.org/PMML-4_2}FIELD-NAME" />
* <attribute name="feature" type="{http://www.dmg.org/PMML-4_2}RESULT-FEATURE" default="predictedValue" />
* <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="ruleFeature" type="{http://www.dmg.org/PMML-4_2}RULE-FEATURE" default="consequent" />
* <attribute name="algorithm" default="exclusiveRecommendation">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="recommendation"/>
* <enumeration value="exclusiveRecommendation"/>
* <enumeration value="ruleAssociation"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute name="rank" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" default="1" />
* <attribute name="rankBasis" default="confidence">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="confidence"/>
* <enumeration value="support"/>
* <enumeration value="lift"/>
* <enumeration value="leverage"/>
* <enumeration value="affinity"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute name="rankOrder" default="descending">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="descending"/>
* <enumeration value="ascending"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute name="isMultiValued" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" default="0" />
* <attribute name="segmentId" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"decisions",
"expression"
})
@XmlRootElement(name = "OutputField")
public class OutputField
extends Field
implements Locatable, HasExtensions
{
@XmlElement(name = "Extension")
protected List extensions;
@XmlElement(name = "Decisions")
@Added(Version.PMML_4_1)
protected Decisions decisions;
@XmlElements({
@XmlElement(name = "Constant", type = Constant.class),
@XmlElement(name = "FieldRef", type = FieldRef.class),
@XmlElement(name = "NormContinuous", type = NormContinuous.class),
@XmlElement(name = "NormDiscrete", type = NormDiscrete.class),
@XmlElement(name = "Discretize", type = Discretize.class),
@XmlElement(name = "MapValues", type = MapValues.class),
@XmlElement(name = "TextIndex", type = TextIndex.class),
@XmlElement(name = "Apply", type = Apply.class),
@XmlElement(name = "Aggregate", type = Aggregate.class)
})
@Added(Version.PMML_4_1)
protected Expression expression;
@XmlAttribute(name = "name", required = true)
@XmlJavaTypeAdapter(FieldNameAdapter.class)
protected FieldName name;
@XmlAttribute(name = "displayName")
protected String displayName;
@XmlAttribute(name = "optype")
protected OpType optype;
@XmlAttribute(name = "dataType")
protected DataType dataType;
@XmlAttribute(name = "targetField")
@XmlJavaTypeAdapter(FieldNameAdapter.class)
protected FieldName targetField;
@XmlAttribute(name = "feature")
protected ResultFeatureType feature;
@XmlAttribute(name = "value")
protected String value;
@XmlAttribute(name = "ruleFeature")
@Added(Version.PMML_4_0)
@Deprecated(Version.PMML_4_2)
protected RuleFeatureType ruleFeature;
@XmlAttribute(name = "algorithm")
@Added(Version.PMML_4_0)
protected OutputField.Algorithm algorithm;
@XmlAttribute(name = "rank")
protected Integer rank;
@XmlAttribute(name = "rankBasis")
@Added(Version.PMML_4_0)
protected OutputField.RankBasis rankBasis;
@XmlAttribute(name = "rankOrder")
@Added(Version.PMML_4_0)
protected OutputField.RankOrder rankOrder;
@XmlAttribute(name = "isMultiValued")
@XmlSchemaType(name = "anySimpleType")
@Added(Version.PMML_4_0)
@Deprecated(Version.PMML_4_2)
protected String isMultiValued;
@XmlAttribute(name = "segmentId")
@Added(Version.PMML_4_1)
protected String segmentId;
@XmlLocation
@XmlTransient
protected Locator locator;
public OutputField() {
super();
}
public OutputField(final FieldName name) {
super();
this.name = name;
}
/**
* Gets the value of the extensions 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 extensions property.
*
*
* For example, to add a new item, do as follows:
*
* getExtensions().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Extension }
*
*
*/
public List getExtensions() {
if (extensions == null) {
extensions = new ArrayList();
}
return this.extensions;
}
/**
* Gets the value of the decisions property.
*
* @return
* possible object is
* {@link Decisions }
*
*/
public Decisions getDecisions() {
return decisions;
}
/**
* Sets the value of the decisions property.
*
* @param value
* allowed object is
* {@link Decisions }
*
*/
public void setDecisions(Decisions value) {
this.decisions = value;
}
/**
* Gets the value of the expression property.
*
* @return
* possible object is
* {@link Constant }
* {@link FieldRef }
* {@link NormContinuous }
* {@link NormDiscrete }
* {@link Discretize }
* {@link MapValues }
* {@link TextIndex }
* {@link Apply }
* {@link Aggregate }
*
*/
public Expression getExpression() {
return expression;
}
/**
* Sets the value of the expression property.
*
* @param value
* allowed object is
* {@link Constant }
* {@link FieldRef }
* {@link NormContinuous }
* {@link NormDiscrete }
* {@link Discretize }
* {@link MapValues }
* {@link TextIndex }
* {@link Apply }
* {@link Aggregate }
*
*/
public void setExpression(Expression value) {
this.expression = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public FieldName getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(FieldName value) {
this.name = value;
}
/**
* Gets the value of the displayName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDisplayName() {
return displayName;
}
/**
* Sets the value of the displayName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDisplayName(String value) {
this.displayName = value;
}
/**
* Gets the value of the optype property.
*
* @return
* possible object is
* {@link OpType }
*
*/
public OpType getOptype() {
return optype;
}
/**
* Sets the value of the optype property.
*
* @param value
* allowed object is
* {@link OpType }
*
*/
public void setOptype(OpType value) {
this.optype = value;
}
/**
* Gets the value of the dataType property.
*
* @return
* possible object is
* {@link DataType }
*
*/
public DataType getDataType() {
return dataType;
}
/**
* Sets the value of the dataType property.
*
* @param value
* allowed object is
* {@link DataType }
*
*/
public void setDataType(DataType value) {
this.dataType = value;
}
/**
* Gets the value of the targetField property.
*
* @return
* possible object is
* {@link String }
*
*/
public FieldName getTargetField() {
return targetField;
}
/**
* Sets the value of the targetField property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTargetField(FieldName value) {
this.targetField = value;
}
/**
* Gets the value of the feature property.
*
* @return
* possible object is
* {@link ResultFeatureType }
*
*/
public ResultFeatureType getFeature() {
if (feature == null) {
return ResultFeatureType.PREDICTED_VALUE;
} else {
return feature;
}
}
/**
* Sets the value of the feature property.
*
* @param value
* allowed object is
* {@link ResultFeatureType }
*
*/
public void setFeature(ResultFeatureType value) {
this.feature = value;
}
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the ruleFeature property.
*
* @return
* possible object is
* {@link RuleFeatureType }
*
*/
public RuleFeatureType getRuleFeature() {
if (ruleFeature == null) {
return RuleFeatureType.CONSEQUENT;
} else {
return ruleFeature;
}
}
/**
* Sets the value of the ruleFeature property.
*
* @param value
* allowed object is
* {@link RuleFeatureType }
*
*/
public void setRuleFeature(RuleFeatureType value) {
this.ruleFeature = value;
}
/**
* Gets the value of the algorithm property.
*
* @return
* possible object is
* {@link OutputField.Algorithm }
*
*/
public OutputField.Algorithm getAlgorithm() {
if (algorithm == null) {
return OutputField.Algorithm.EXCLUSIVE_RECOMMENDATION;
} else {
return algorithm;
}
}
/**
* Sets the value of the algorithm property.
*
* @param value
* allowed object is
* {@link OutputField.Algorithm }
*
*/
public void setAlgorithm(OutputField.Algorithm value) {
this.algorithm = value;
}
/**
* Gets the value of the rank property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public int getRank() {
if (rank == null) {
return 1;
} else {
return rank;
}
}
/**
* Sets the value of the rank property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setRank(Integer value) {
this.rank = value;
}
/**
* Gets the value of the rankBasis property.
*
* @return
* possible object is
* {@link OutputField.RankBasis }
*
*/
public OutputField.RankBasis getRankBasis() {
if (rankBasis == null) {
return OutputField.RankBasis.CONFIDENCE;
} else {
return rankBasis;
}
}
/**
* Sets the value of the rankBasis property.
*
* @param value
* allowed object is
* {@link OutputField.RankBasis }
*
*/
public void setRankBasis(OutputField.RankBasis value) {
this.rankBasis = value;
}
/**
* Gets the value of the rankOrder property.
*
* @return
* possible object is
* {@link OutputField.RankOrder }
*
*/
public OutputField.RankOrder getRankOrder() {
if (rankOrder == null) {
return OutputField.RankOrder.DESCENDING;
} else {
return rankOrder;
}
}
/**
* Sets the value of the rankOrder property.
*
* @param value
* allowed object is
* {@link OutputField.RankOrder }
*
*/
public void setRankOrder(OutputField.RankOrder value) {
this.rankOrder = value;
}
/**
* Gets the value of the isMultiValued property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getIsMultiValued() {
if (isMultiValued == null) {
return "0";
} else {
return isMultiValued;
}
}
/**
* Sets the value of the isMultiValued property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setIsMultiValued(String value) {
this.isMultiValued = value;
}
/**
* Gets the value of the segmentId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSegmentId() {
return segmentId;
}
/**
* Sets the value of the segmentId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSegmentId(String value) {
this.segmentId = value;
}
public OutputField withExtensions(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtensions().add(value);
}
}
return this;
}
public OutputField withExtensions(Collection values) {
if (values!= null) {
getExtensions().addAll(values);
}
return this;
}
public OutputField withDecisions(Decisions value) {
setDecisions(value);
return this;
}
public OutputField withExpression(Expression value) {
setExpression(value);
return this;
}
public OutputField withName(FieldName value) {
setName(value);
return this;
}
public OutputField withDisplayName(String value) {
setDisplayName(value);
return this;
}
public OutputField withOptype(OpType value) {
setOptype(value);
return this;
}
public OutputField withDataType(DataType value) {
setDataType(value);
return this;
}
public OutputField withTargetField(FieldName value) {
setTargetField(value);
return this;
}
public OutputField withFeature(ResultFeatureType value) {
setFeature(value);
return this;
}
public OutputField withValue(String value) {
setValue(value);
return this;
}
public OutputField withRuleFeature(RuleFeatureType value) {
setRuleFeature(value);
return this;
}
public OutputField withAlgorithm(OutputField.Algorithm value) {
setAlgorithm(value);
return this;
}
public OutputField withRank(Integer value) {
setRank(value);
return this;
}
public OutputField withRankBasis(OutputField.RankBasis value) {
setRankBasis(value);
return this;
}
public OutputField withRankOrder(OutputField.RankOrder value) {
setRankOrder(value);
return this;
}
public OutputField withIsMultiValued(String value) {
setIsMultiValued(value);
return this;
}
public OutputField withSegmentId(String value) {
setSegmentId(value);
return this;
}
public Locator sourceLocation() {
return locator;
}
public void setSourceLocation(Locator newLocator) {
locator = newLocator;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
for (int i = 0; (((status == VisitorAction.CONTINUE)&&(this.extensions!= null))&&(iJava class for null.
*
* The following schema fragment specifies the expected content contained within this class.
*
*
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="recommendation"/>
* <enumeration value="exclusiveRecommendation"/>
* <enumeration value="ruleAssociation"/>
* </restriction>
* </simpleType>
*
*
*/
@XmlType(name = "")
@XmlEnum
@Added(Version.PMML_4_0)
public enum Algorithm {
@XmlEnumValue("recommendation")
RECOMMENDATION("recommendation"),
@XmlEnumValue("exclusiveRecommendation")
EXCLUSIVE_RECOMMENDATION("exclusiveRecommendation"),
@XmlEnumValue("ruleAssociation")
RULE_ASSOCIATION("ruleAssociation");
private final String value;
Algorithm(String v) {
value = v;
}
public String value() {
return value;
}
public static OutputField.Algorithm fromValue(String v) {
for (OutputField.Algorithm c: OutputField.Algorithm.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
/**
* Java class for null.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="confidence"/>
* <enumeration value="support"/>
* <enumeration value="lift"/>
* <enumeration value="leverage"/>
* <enumeration value="affinity"/>
* </restriction>
* </simpleType>
*
*
*/
@XmlType(name = "")
@XmlEnum
@Added(Version.PMML_4_0)
public enum RankBasis {
@XmlEnumValue("confidence")
CONFIDENCE("confidence"),
@XmlEnumValue("support")
SUPPORT("support"),
@XmlEnumValue("lift")
LIFT("lift"),
@XmlEnumValue("leverage")
@Added(Version.PMML_4_1)
LEVERAGE("leverage"),
@XmlEnumValue("affinity")
@Added(Version.PMML_4_1)
AFFINITY("affinity");
private final String value;
RankBasis(String v) {
value = v;
}
public String value() {
return value;
}
public static OutputField.RankBasis fromValue(String v) {
for (OutputField.RankBasis c: OutputField.RankBasis.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
/**
* Java class for null.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="descending"/>
* <enumeration value="ascending"/>
* </restriction>
* </simpleType>
*
*
*/
@XmlType(name = "")
@XmlEnum
@Added(Version.PMML_4_0)
public enum RankOrder {
@XmlEnumValue("descending")
DESCENDING("descending"),
@XmlEnumValue("ascending")
ASCENDING("ascending");
private final String value;
RankOrder(String v) {
value = v;
}
public String value() {
return value;
}
public static OutputField.RankOrder fromValue(String v) {
for (OutputField.RankOrder c: OutputField.RankOrder.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
}