org.dmg.pmml.NeuralNetwork 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}ModelExplanation" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}Targets" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}LocalTransformations" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}NeuralInputs"/>
* <element ref="{http://www.dmg.org/PMML-4_2}NeuralLayer" maxOccurs="unbounded"/>
* <element ref="{http://www.dmg.org/PMML-4_2}NeuralOutputs" 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="activationFunction" use="required" type="{http://www.dmg.org/PMML-4_2}ACTIVATION-FUNCTION" />
* <attribute name="normalizationMethod" type="{http://www.dmg.org/PMML-4_2}NN-NORMALIZATION-METHOD" default="none" />
* <attribute name="threshold" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" default="0" />
* <attribute name="width" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="altitude" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" default="1.0" />
* <attribute name="numberOfLayers" type="{http://www.w3.org/2001/XMLSchema}int" />
* <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",
"modelExplanation",
"targets",
"localTransformations",
"neuralInputs",
"neuralLayers",
"neuralOutputs",
"modelVerification"
})
@XmlRootElement(name = "NeuralNetwork")
public class NeuralNetwork
extends Model
implements Locatable, HasExtensions
{
@XmlElement(name = "Extension")
protected List extensions;
@XmlElement(name = "MiningSchema", required = true)
protected MiningSchema miningSchema;
@XmlElement(name = "Output")
protected Output output;
@XmlElement(name = "ModelStats")
protected ModelStats modelStats;
@XmlElement(name = "ModelExplanation")
@Added(Version.PMML_4_0)
protected ModelExplanation modelExplanation;
@XmlElement(name = "Targets")
protected Targets targets;
@XmlElement(name = "LocalTransformations")
protected LocalTransformations localTransformations;
@XmlElement(name = "NeuralInputs", required = true)
protected NeuralInputs neuralInputs;
@XmlElement(name = "NeuralLayer", required = true)
protected List neuralLayers;
@XmlElement(name = "NeuralOutputs")
protected NeuralOutputs neuralOutputs;
@XmlElement(name = "ModelVerification")
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 = "activationFunction", required = true)
protected ActivationFunctionType activationFunction;
@XmlAttribute(name = "normalizationMethod")
protected NnNormalizationMethodType normalizationMethod;
@XmlAttribute(name = "threshold")
protected Double threshold;
@XmlAttribute(name = "width")
protected Double width;
@XmlAttribute(name = "altitude")
protected Double altitude;
@XmlAttribute(name = "numberOfLayers")
protected Integer numberOfLayers;
@XmlAttribute(name = "isScorable")
@Added(Version.PMML_4_1)
protected Boolean scorable;
@XmlLocation
@XmlTransient
protected Locator locator;
public NeuralNetwork() {
super();
}
public NeuralNetwork(final MiningSchema miningSchema, final NeuralInputs neuralInputs, final MiningFunctionType functionName, final ActivationFunctionType activationFunction) {
super();
this.miningSchema = miningSchema;
this.neuralInputs = neuralInputs;
this.functionName = functionName;
this.activationFunction = activationFunction;
}
/**
* 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 modelExplanation property.
*
* @return
* possible object is
* {@link ModelExplanation }
*
*/
public ModelExplanation getModelExplanation() {
return modelExplanation;
}
/**
* Sets the value of the modelExplanation property.
*
* @param value
* allowed object is
* {@link ModelExplanation }
*
*/
public void setModelExplanation(ModelExplanation value) {
this.modelExplanation = value;
}
/**
* Gets the value of the targets property.
*
* @return
* possible object is
* {@link Targets }
*
*/
public Targets getTargets() {
return targets;
}
/**
* Sets the value of the targets property.
*
* @param value
* allowed object is
* {@link Targets }
*
*/
public void setTargets(Targets value) {
this.targets = 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 neuralInputs property.
*
* @return
* possible object is
* {@link NeuralInputs }
*
*/
public NeuralInputs getNeuralInputs() {
return neuralInputs;
}
/**
* Sets the value of the neuralInputs property.
*
* @param value
* allowed object is
* {@link NeuralInputs }
*
*/
public void setNeuralInputs(NeuralInputs value) {
this.neuralInputs = value;
}
/**
* Gets the value of the neuralLayers 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 neuralLayers property.
*
*
* For example, to add a new item, do as follows:
*
* getNeuralLayers().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link NeuralLayer }
*
*
*/
public List getNeuralLayers() {
if (neuralLayers == null) {
neuralLayers = new ArrayList();
}
return this.neuralLayers;
}
/**
* Gets the value of the neuralOutputs property.
*
* @return
* possible object is
* {@link NeuralOutputs }
*
*/
public NeuralOutputs getNeuralOutputs() {
return neuralOutputs;
}
/**
* Sets the value of the neuralOutputs property.
*
* @param value
* allowed object is
* {@link NeuralOutputs }
*
*/
public void setNeuralOutputs(NeuralOutputs value) {
this.neuralOutputs = value;
}
/**
* 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 activationFunction property.
*
* @return
* possible object is
* {@link ActivationFunctionType }
*
*/
public ActivationFunctionType getActivationFunction() {
return activationFunction;
}
/**
* Sets the value of the activationFunction property.
*
* @param value
* allowed object is
* {@link ActivationFunctionType }
*
*/
public void setActivationFunction(ActivationFunctionType value) {
this.activationFunction = value;
}
/**
* Gets the value of the normalizationMethod property.
*
* @return
* possible object is
* {@link NnNormalizationMethodType }
*
*/
public NnNormalizationMethodType getNormalizationMethod() {
if (normalizationMethod == null) {
return NnNormalizationMethodType.NONE;
} else {
return normalizationMethod;
}
}
/**
* Sets the value of the normalizationMethod property.
*
* @param value
* allowed object is
* {@link NnNormalizationMethodType }
*
*/
public void setNormalizationMethod(NnNormalizationMethodType value) {
this.normalizationMethod = value;
}
/**
* Gets the value of the threshold property.
*
* @return
* possible object is
* {@link Double }
*
*/
public double getThreshold() {
if (threshold == null) {
return 0.0D;
} else {
return threshold;
}
}
/**
* Sets the value of the threshold property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setThreshold(Double value) {
this.threshold = value;
}
/**
* Gets the value of the width property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getWidth() {
return width;
}
/**
* Sets the value of the width property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setWidth(Double value) {
this.width = value;
}
/**
* Gets the value of the altitude property.
*
* @return
* possible object is
* {@link Double }
*
*/
public double getAltitude() {
if (altitude == null) {
return 1.0D;
} else {
return altitude;
}
}
/**
* Sets the value of the altitude property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setAltitude(Double value) {
this.altitude = value;
}
/**
* Gets the value of the numberOfLayers property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getNumberOfLayers() {
return numberOfLayers;
}
/**
* Sets the value of the numberOfLayers property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setNumberOfLayers(Integer value) {
this.numberOfLayers = 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 NeuralNetwork withExtensions(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtensions().add(value);
}
}
return this;
}
public NeuralNetwork withExtensions(Collection values) {
if (values!= null) {
getExtensions().addAll(values);
}
return this;
}
public NeuralNetwork withMiningSchema(MiningSchema value) {
setMiningSchema(value);
return this;
}
public NeuralNetwork withOutput(Output value) {
setOutput(value);
return this;
}
public NeuralNetwork withModelStats(ModelStats value) {
setModelStats(value);
return this;
}
public NeuralNetwork withModelExplanation(ModelExplanation value) {
setModelExplanation(value);
return this;
}
public NeuralNetwork withTargets(Targets value) {
setTargets(value);
return this;
}
public NeuralNetwork withLocalTransformations(LocalTransformations value) {
setLocalTransformations(value);
return this;
}
public NeuralNetwork withNeuralInputs(NeuralInputs value) {
setNeuralInputs(value);
return this;
}
public NeuralNetwork withNeuralLayers(NeuralLayer... values) {
if (values!= null) {
for (NeuralLayer value: values) {
getNeuralLayers().add(value);
}
}
return this;
}
public NeuralNetwork withNeuralLayers(Collection values) {
if (values!= null) {
getNeuralLayers().addAll(values);
}
return this;
}
public NeuralNetwork withNeuralOutputs(NeuralOutputs value) {
setNeuralOutputs(value);
return this;
}
public NeuralNetwork withModelVerification(ModelVerification value) {
setModelVerification(value);
return this;
}
public NeuralNetwork withModelName(String value) {
setModelName(value);
return this;
}
public NeuralNetwork withFunctionName(MiningFunctionType value) {
setFunctionName(value);
return this;
}
public NeuralNetwork withAlgorithmName(String value) {
setAlgorithmName(value);
return this;
}
public NeuralNetwork withActivationFunction(ActivationFunctionType value) {
setActivationFunction(value);
return this;
}
public NeuralNetwork withNormalizationMethod(NnNormalizationMethodType value) {
setNormalizationMethod(value);
return this;
}
public NeuralNetwork withThreshold(Double value) {
setThreshold(value);
return this;
}
public NeuralNetwork withWidth(Double value) {
setWidth(value);
return this;
}
public NeuralNetwork withAltitude(Double value) {
setAltitude(value);
return this;
}
public NeuralNetwork withNumberOfLayers(Integer value) {
setNumberOfLayers(value);
return this;
}
public NeuralNetwork withScorable(Boolean value) {
setScorable(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))&&(i