org.dmg.pmml.AssociationModel 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.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.sun.xml.bind.Locatable;
import com.sun.xml.bind.annotation.XmlLocation;
import org.jpmml.schema.Added;
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"/>
* <element ref="{http://www.dmg.org/PMML-4_2}MiningSchema"/>
* <element ref="{http://www.dmg.org/PMML-4_2}Output" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}ModelStats" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}LocalTransformations" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}Item" maxOccurs="unbounded" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}Itemset" maxOccurs="unbounded" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}AssociationRule" maxOccurs="unbounded" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}ModelVerification" minOccurs="0"/>
* </sequence>
* <attribute name="modelName" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="functionName" use="required" type="{http://www.dmg.org/PMML-4_2}MINING-FUNCTION" />
* <attribute name="algorithmName" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="numberOfTransactions" use="required" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="maxNumberOfItemsPerTA" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="avgNumberOfItemsPerTA" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="minimumSupport" use="required" type="{http://www.dmg.org/PMML-4_2}PROB-NUMBER" />
* <attribute name="minimumConfidence" use="required" type="{http://www.dmg.org/PMML-4_2}PROB-NUMBER" />
* <attribute name="lengthLimit" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="numberOfItems" use="required" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="numberOfItemsets" use="required" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="numberOfRules" use="required" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="isScorable" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"miningSchema",
"output",
"modelStats",
"localTransformations",
"items",
"itemsets",
"associationRules",
"modelVerification"
})
@XmlRootElement(name = "AssociationModel")
public class AssociationModel
extends Model
implements Locatable, HasExtensions
{
@XmlElement(name = "Extension")
protected List extensions;
@XmlElement(name = "MiningSchema", required = true)
protected MiningSchema miningSchema;
@XmlElement(name = "Output")
@Added(Version.PMML_4_0)
protected Output output;
@XmlElement(name = "ModelStats")
protected ModelStats modelStats;
@XmlElement(name = "LocalTransformations")
protected LocalTransformations localTransformations;
@XmlElement(name = "Item")
protected List- items;
@XmlElement(name = "Itemset")
protected List
itemsets;
@XmlElement(name = "AssociationRule")
protected List associationRules;
@XmlElement(name = "ModelVerification")
@Added(Version.PMML_4_1)
protected ModelVerification modelVerification;
@XmlAttribute(name = "modelName")
protected String modelName;
@XmlAttribute(name = "functionName", required = true)
protected MiningFunctionType functionName;
@XmlAttribute(name = "algorithmName")
protected String algorithmName;
@XmlAttribute(name = "numberOfTransactions", required = true)
protected int numberOfTransactions;
@XmlAttribute(name = "maxNumberOfItemsPerTA")
protected Integer maxNumberOfItemsPerTA;
@XmlAttribute(name = "avgNumberOfItemsPerTA")
protected Double avgNumberOfItemsPerTA;
@XmlAttribute(name = "minimumSupport", required = true)
protected double minimumSupport;
@XmlAttribute(name = "minimumConfidence", required = true)
protected double minimumConfidence;
@XmlAttribute(name = "lengthLimit")
protected Integer lengthLimit;
@XmlAttribute(name = "numberOfItems", required = true)
protected int numberOfItems;
@XmlAttribute(name = "numberOfItemsets", required = true)
protected int numberOfItemsets;
@XmlAttribute(name = "numberOfRules", required = true)
protected int numberOfRules;
@XmlAttribute(name = "isScorable")
@Added(Version.PMML_4_1)
protected Boolean scorable;
@XmlLocation
@XmlTransient
protected Locator locator;
public AssociationModel() {
super();
}
public AssociationModel(final MiningSchema miningSchema, final MiningFunctionType functionName, final int numberOfTransactions, final double minimumSupport, final double minimumConfidence, final int numberOfItems, final int numberOfItemsets, final int numberOfRules) {
super();
this.miningSchema = miningSchema;
this.functionName = functionName;
this.numberOfTransactions = numberOfTransactions;
this.minimumSupport = minimumSupport;
this.minimumConfidence = minimumConfidence;
this.numberOfItems = numberOfItems;
this.numberOfItemsets = numberOfItemsets;
this.numberOfRules = numberOfRules;
}
/**
* 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 miningSchema property.
*
* @return
* possible object is
* {@link MiningSchema }
*
*/
public MiningSchema getMiningSchema() {
return miningSchema;
}
/**
* Sets the value of the miningSchema property.
*
* @param value
* allowed object is
* {@link MiningSchema }
*
*/
public void setMiningSchema(MiningSchema value) {
this.miningSchema = value;
}
/**
* Gets the value of the output property.
*
* @return
* possible object is
* {@link Output }
*
*/
public Output getOutput() {
return output;
}
/**
* Sets the value of the output property.
*
* @param value
* allowed object is
* {@link Output }
*
*/
public void setOutput(Output value) {
this.output = value;
}
/**
* Gets the value of the modelStats property.
*
* @return
* possible object is
* {@link ModelStats }
*
*/
public ModelStats getModelStats() {
return modelStats;
}
/**
* Sets the value of the modelStats property.
*
* @param value
* allowed object is
* {@link ModelStats }
*
*/
public void setModelStats(ModelStats value) {
this.modelStats = value;
}
/**
* Gets the value of the localTransformations property.
*
* @return
* possible object is
* {@link LocalTransformations }
*
*/
public LocalTransformations getLocalTransformations() {
return localTransformations;
}
/**
* Sets the value of the localTransformations property.
*
* @param value
* allowed object is
* {@link LocalTransformations }
*
*/
public void setLocalTransformations(LocalTransformations value) {
this.localTransformations = value;
}
/**
* Gets the value of the items 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 items property.
*
*
* For example, to add a new item, do as follows:
*
* getItems().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Item }
*
*
*/
public List- getItems() {
if (items == null) {
items = new ArrayList
- ();
}
return this.items;
}
/**
* Gets the value of the itemsets 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 itemsets property.
*
*
* For example, to add a new item, do as follows:
*
* getItemsets().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Itemset }
*
*
*/
public List getItemsets() {
if (itemsets == null) {
itemsets = new ArrayList();
}
return this.itemsets;
}
/**
* Gets the value of the associationRules 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 associationRules property.
*
*
* For example, to add a new item, do as follows:
*
* getAssociationRules().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link AssociationRule }
*
*
*/
public List getAssociationRules() {
if (associationRules == null) {
associationRules = new ArrayList();
}
return this.associationRules;
}
/**
* Gets the value of the modelVerification property.
*
* @return
* possible object is
* {@link ModelVerification }
*
*/
public ModelVerification getModelVerification() {
return modelVerification;
}
/**
* Sets the value of the modelVerification property.
*
* @param value
* allowed object is
* {@link ModelVerification }
*
*/
public void setModelVerification(ModelVerification value) {
this.modelVerification = value;
}
/**
* Gets the value of the modelName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getModelName() {
return modelName;
}
/**
* Sets the value of the modelName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setModelName(String value) {
this.modelName = value;
}
/**
* Gets the value of the functionName property.
*
* @return
* possible object is
* {@link MiningFunctionType }
*
*/
public MiningFunctionType getFunctionName() {
return functionName;
}
/**
* Sets the value of the functionName property.
*
* @param value
* allowed object is
* {@link MiningFunctionType }
*
*/
public void setFunctionName(MiningFunctionType value) {
this.functionName = value;
}
/**
* Gets the value of the algorithmName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAlgorithmName() {
return algorithmName;
}
/**
* Sets the value of the algorithmName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAlgorithmName(String value) {
this.algorithmName = value;
}
/**
* Gets the value of the numberOfTransactions property.
*
*/
public int getNumberOfTransactions() {
return numberOfTransactions;
}
/**
* Sets the value of the numberOfTransactions property.
*
*/
public void setNumberOfTransactions(int value) {
this.numberOfTransactions = value;
}
/**
* Gets the value of the maxNumberOfItemsPerTA property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getMaxNumberOfItemsPerTA() {
return maxNumberOfItemsPerTA;
}
/**
* Sets the value of the maxNumberOfItemsPerTA property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setMaxNumberOfItemsPerTA(Integer value) {
this.maxNumberOfItemsPerTA = value;
}
/**
* Gets the value of the avgNumberOfItemsPerTA property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getAvgNumberOfItemsPerTA() {
return avgNumberOfItemsPerTA;
}
/**
* Sets the value of the avgNumberOfItemsPerTA property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setAvgNumberOfItemsPerTA(Double value) {
this.avgNumberOfItemsPerTA = value;
}
/**
* Gets the value of the minimumSupport property.
*
*/
public double getMinimumSupport() {
return minimumSupport;
}
/**
* Sets the value of the minimumSupport property.
*
*/
public void setMinimumSupport(double value) {
this.minimumSupport = value;
}
/**
* Gets the value of the minimumConfidence property.
*
*/
public double getMinimumConfidence() {
return minimumConfidence;
}
/**
* Sets the value of the minimumConfidence property.
*
*/
public void setMinimumConfidence(double value) {
this.minimumConfidence = value;
}
/**
* Gets the value of the lengthLimit property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getLengthLimit() {
return lengthLimit;
}
/**
* Sets the value of the lengthLimit property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setLengthLimit(Integer value) {
this.lengthLimit = value;
}
/**
* Gets the value of the numberOfItems property.
*
*/
public int getNumberOfItems() {
return numberOfItems;
}
/**
* Sets the value of the numberOfItems property.
*
*/
public void setNumberOfItems(int value) {
this.numberOfItems = value;
}
/**
* Gets the value of the numberOfItemsets property.
*
*/
public int getNumberOfItemsets() {
return numberOfItemsets;
}
/**
* Sets the value of the numberOfItemsets property.
*
*/
public void setNumberOfItemsets(int value) {
this.numberOfItemsets = value;
}
/**
* Gets the value of the numberOfRules property.
*
*/
public int getNumberOfRules() {
return numberOfRules;
}
/**
* Sets the value of the numberOfRules property.
*
*/
public void setNumberOfRules(int value) {
this.numberOfRules = value;
}
/**
* Gets the value of the scorable property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public boolean isScorable() {
if (scorable == null) {
return true;
} else {
return scorable;
}
}
/**
* Sets the value of the scorable property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setScorable(Boolean value) {
this.scorable = value;
}
public AssociationModel withExtensions(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtensions().add(value);
}
}
return this;
}
public AssociationModel withExtensions(Collection values) {
if (values!= null) {
getExtensions().addAll(values);
}
return this;
}
public AssociationModel withMiningSchema(MiningSchema value) {
setMiningSchema(value);
return this;
}
public AssociationModel withOutput(Output value) {
setOutput(value);
return this;
}
public AssociationModel withModelStats(ModelStats value) {
setModelStats(value);
return this;
}
public AssociationModel withLocalTransformations(LocalTransformations value) {
setLocalTransformations(value);
return this;
}
public AssociationModel withItems(Item... values) {
if (values!= null) {
for (Item value: values) {
getItems().add(value);
}
}
return this;
}
public AssociationModel withItems(Collection- values) {
if (values!= null) {
getItems().addAll(values);
}
return this;
}
public AssociationModel withItemsets(Itemset... values) {
if (values!= null) {
for (Itemset value: values) {
getItemsets().add(value);
}
}
return this;
}
public AssociationModel withItemsets(Collection
values) {
if (values!= null) {
getItemsets().addAll(values);
}
return this;
}
public AssociationModel withAssociationRules(AssociationRule... values) {
if (values!= null) {
for (AssociationRule value: values) {
getAssociationRules().add(value);
}
}
return this;
}
public AssociationModel withAssociationRules(Collection values) {
if (values!= null) {
getAssociationRules().addAll(values);
}
return this;
}
public AssociationModel withModelVerification(ModelVerification value) {
setModelVerification(value);
return this;
}
public AssociationModel withModelName(String value) {
setModelName(value);
return this;
}
public AssociationModel withFunctionName(MiningFunctionType value) {
setFunctionName(value);
return this;
}
public AssociationModel withAlgorithmName(String value) {
setAlgorithmName(value);
return this;
}
public AssociationModel withNumberOfTransactions(int value) {
setNumberOfTransactions(value);
return this;
}
public AssociationModel withMaxNumberOfItemsPerTA(Integer value) {
setMaxNumberOfItemsPerTA(value);
return this;
}
public AssociationModel withAvgNumberOfItemsPerTA(Double value) {
setAvgNumberOfItemsPerTA(value);
return this;
}
public AssociationModel withMinimumSupport(double value) {
setMinimumSupport(value);
return this;
}
public AssociationModel withMinimumConfidence(double value) {
setMinimumConfidence(value);
return this;
}
public AssociationModel withLengthLimit(Integer value) {
setLengthLimit(value);
return this;
}
public AssociationModel withNumberOfItems(int value) {
setNumberOfItems(value);
return this;
}
public AssociationModel withNumberOfItemsets(int value) {
setNumberOfItemsets(value);
return this;
}
public AssociationModel withNumberOfRules(int value) {
setNumberOfRules(value);
return this;
}
public AssociationModel withScorable(Boolean value) {
setScorable(value);
return this;
}
public Locator sourceLocation() {
return locator;
}
public void setSourceLocation(Locator newLocator) {
locator = newLocator;
}
/**
* Gets the value of the targets property.
*
* @throws UnsupportedOperationException
* Always.
*/
@Override
public Targets getTargets() {
throw new UnsupportedOperationException();
}
/**
* Sets the value of the targets property.
*
* @throws UnsupportedOperationException
* Always.
*/
@Override
public void setTargets(Targets targets) {
throw new UnsupportedOperationException();
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
for (int i = 0; (((status == VisitorAction.CONTINUE)&&(this.extensions!= null))&&(i