org.dmg.pmml.ExponentialSmoothing Maven / Gradle / Ivy
Show all versions of pmml-model-gwt Show documentation
package org.dmg.pmml;
import java.util.ArrayList;
import java.util.Arrays;
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.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jpmml.schema.Added;
import org.jpmml.schema.Version;
/**
* 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}Level"/>
* <element ref="{http://www.dmg.org/PMML-4_2}Trend_ExpoSmooth" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}Seasonality_ExpoSmooth" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}TimeValue" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="RMSE" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="transformation" default="none">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* <enumeration value="none"/>
* <enumeration value="logarithmic"/>
* <enumeration value="squareroot"/>
* </restriction>
* </simpleType>
* </attribute>
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"level",
"trendExpoSmooth",
"seasonalityExpoSmooth",
"timeValues"
})
@XmlRootElement(name = "ExponentialSmoothing", namespace = "http://www.dmg.org/PMML-4_2")
@Added(Version.PMML_4_0)
public class ExponentialSmoothing
extends TimeSeriesAlgorithm
{
@XmlAttribute(name = "RMSE")
private Double rmse;
@XmlAttribute(name = "transformation")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
private String transformation;
@XmlElement(name = "Level", namespace = "http://www.dmg.org/PMML-4_2", required = true)
private Level level;
@XmlElement(name = "Trend_ExpoSmooth", namespace = "http://www.dmg.org/PMML-4_2")
private TrendExpoSmooth trendExpoSmooth;
@XmlElement(name = "Seasonality_ExpoSmooth", namespace = "http://www.dmg.org/PMML-4_2")
private SeasonalityExpoSmooth seasonalityExpoSmooth;
@XmlElement(name = "TimeValue", namespace = "http://www.dmg.org/PMML-4_2")
private List timeValues;
public ExponentialSmoothing() {
super();
}
public ExponentialSmoothing(final Level level) {
super();
this.level = level;
}
/**
* Gets the value of the rmse property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getRMSE() {
return rmse;
}
/**
* Sets the value of the rmse property.
*
* @param rmse
* allowed object is
* {@link Double }
*
*/
public ExponentialSmoothing setRMSE(Double rmse) {
this.rmse = rmse;
return this;
}
/**
* Gets the value of the transformation property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTransformation() {
if (transformation == null) {
return "none";
} else {
return transformation;
}
}
/**
* Sets the value of the transformation property.
*
* @param transformation
* allowed object is
* {@link String }
*
*/
public ExponentialSmoothing setTransformation(String transformation) {
this.transformation = transformation;
return this;
}
/**
* Gets the value of the level property.
*
* @return
* possible object is
* {@link Level }
*
*/
public Level getLevel() {
return level;
}
/**
* Sets the value of the level property.
*
* @param level
* allowed object is
* {@link Level }
*
*/
public ExponentialSmoothing setLevel(Level level) {
this.level = level;
return this;
}
/**
* Gets the value of the trendExpoSmooth property.
*
* @return
* possible object is
* {@link TrendExpoSmooth }
*
*/
public TrendExpoSmooth getTrendExpoSmooth() {
return trendExpoSmooth;
}
/**
* Sets the value of the trendExpoSmooth property.
*
* @param trendExpoSmooth
* allowed object is
* {@link TrendExpoSmooth }
*
*/
public ExponentialSmoothing setTrendExpoSmooth(TrendExpoSmooth trendExpoSmooth) {
this.trendExpoSmooth = trendExpoSmooth;
return this;
}
/**
* Gets the value of the seasonalityExpoSmooth property.
*
* @return
* possible object is
* {@link SeasonalityExpoSmooth }
*
*/
public SeasonalityExpoSmooth getSeasonalityExpoSmooth() {
return seasonalityExpoSmooth;
}
/**
* Sets the value of the seasonalityExpoSmooth property.
*
* @param seasonalityExpoSmooth
* allowed object is
* {@link SeasonalityExpoSmooth }
*
*/
public ExponentialSmoothing setSeasonalityExpoSmooth(SeasonalityExpoSmooth seasonalityExpoSmooth) {
this.seasonalityExpoSmooth = seasonalityExpoSmooth;
return this;
}
/**
* Gets the value of the timeValues 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 timeValues property.
*
*
* For example, to add a new item, do as follows:
*
* getTimeValues().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link TimeValue }
*
*
*/
public List getTimeValues() {
if (timeValues == null) {
timeValues = new ArrayList();
}
return this.timeValues;
}
public boolean hasTimeValues() {
return ((this.timeValues!= null)&&(this.timeValues.size()> 0));
}
public ExponentialSmoothing addTimeValues(TimeValue... timeValues) {
getTimeValues().addAll(Arrays.asList(timeValues));
return this;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
visitor.pushParent(this);
if (status == VisitorAction.CONTINUE) {
status = PMMLObject.traverse(visitor, getLevel(), getTrendExpoSmooth(), getSeasonalityExpoSmooth());
}
if ((status == VisitorAction.CONTINUE)&&hasTimeValues()) {
status = PMMLObject.traverse(visitor, getTimeValues());
}
visitor.popParent();
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
}