All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dmg.pmml.ROC Maven / Gradle / Ivy

There is a newer version: 1.6.5
Show newest version

package org.dmg.pmml;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonRootName;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
import org.jpmml.model.MissingAttributeException;
import org.jpmml.model.MissingElementException;
import org.jpmml.model.annotations.Added;
import org.jpmml.model.annotations.ValueConstructor;

@XmlRootElement(name = "ROC", namespace = "http://www.dmg.org/PMML-4_4")
@XmlType(name = "", propOrder = {
    "extensions",
    "rocGraph"
})
@JsonRootName("ROC")
@JsonPropertyOrder({
    "positiveTargetFieldValue",
    "positiveTargetFieldDisplayValue",
    "negativeTargetFieldValue",
    "negativeTargetFieldDisplayValue",
    "extensions",
    "rocGraph"
})
@Added((org.dmg.pmml.Version.PMML_4_0))
public class ROC
    extends org.dmg.pmml.PMMLObject
    implements HasExtensions
{

    @XmlAttribute(name = "positiveTargetFieldValue", required = true)
    @JsonProperty("positiveTargetFieldValue")
    private String positiveTargetFieldValue;
    @XmlAttribute(name = "positiveTargetFieldDisplayValue")
    @JsonProperty("positiveTargetFieldDisplayValue")
    private String positiveTargetFieldDisplayValue;
    @XmlAttribute(name = "negativeTargetFieldValue")
    @JsonProperty("negativeTargetFieldValue")
    private String negativeTargetFieldValue;
    @XmlAttribute(name = "negativeTargetFieldDisplayValue")
    @JsonProperty("negativeTargetFieldDisplayValue")
    private String negativeTargetFieldDisplayValue;
    @XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_4")
    @JsonProperty("Extension")
    private List extensions;
    @XmlElement(name = "ROCGraph", namespace = "http://www.dmg.org/PMML-4_4", required = true)
    @JsonProperty("ROCGraph")
    private ROCGraph rocGraph;
    private final static long serialVersionUID = 67371270L;

    public ROC() {
    }

    @ValueConstructor
    public ROC(
        @org.jpmml.model.annotations.Property("positiveTargetFieldValue")
        String positiveTargetFieldValue,
        @org.jpmml.model.annotations.Property("rocGraph")
        ROCGraph rocGraph) {
        this.positiveTargetFieldValue = positiveTargetFieldValue;
        this.rocGraph = rocGraph;
    }

    public String requirePositiveTargetFieldValue() {
        if (this.positiveTargetFieldValue == null) {
            throw new MissingAttributeException(this, PMMLAttributes.ROC_POSITIVETARGETFIELDVALUE);
        }
        return this.positiveTargetFieldValue;
    }

    public String getPositiveTargetFieldValue() {
        return positiveTargetFieldValue;
    }

    public ROC setPositiveTargetFieldValue(
        @org.jpmml.model.annotations.Property("positiveTargetFieldValue")
        String positiveTargetFieldValue) {
        this.positiveTargetFieldValue = positiveTargetFieldValue;
        return this;
    }

    public String getPositiveTargetFieldDisplayValue() {
        return positiveTargetFieldDisplayValue;
    }

    public ROC setPositiveTargetFieldDisplayValue(
        @org.jpmml.model.annotations.Property("positiveTargetFieldDisplayValue")
        String positiveTargetFieldDisplayValue) {
        this.positiveTargetFieldDisplayValue = positiveTargetFieldDisplayValue;
        return this;
    }

    public String getNegativeTargetFieldValue() {
        return negativeTargetFieldValue;
    }

    public ROC setNegativeTargetFieldValue(
        @org.jpmml.model.annotations.Property("negativeTargetFieldValue")
        String negativeTargetFieldValue) {
        this.negativeTargetFieldValue = negativeTargetFieldValue;
        return this;
    }

    public String getNegativeTargetFieldDisplayValue() {
        return negativeTargetFieldDisplayValue;
    }

    public ROC setNegativeTargetFieldDisplayValue(
        @org.jpmml.model.annotations.Property("negativeTargetFieldDisplayValue")
        String negativeTargetFieldDisplayValue) {
        this.negativeTargetFieldDisplayValue = negativeTargetFieldDisplayValue;
        return this;
    }

    @Override
    public boolean hasExtensions() {
        return ((this.extensions!= null)&&(!this.extensions.isEmpty()));
    }

    @Override
    public List getExtensions() {
        if (extensions == null) {
            extensions = new ArrayList();
        }
        return this.extensions;
    }

    @Override
    public ROC addExtensions(Extension... extensions) {
        getExtensions().addAll(Arrays.asList(extensions));
        return this;
    }

    public ROCGraph requireROCGraph() {
        if (this.rocGraph == null) {
            throw new MissingElementException(this, PMMLElements.ROC_ROCGRAPH);
        }
        return this.rocGraph;
    }

    public ROCGraph getROCGraph() {
        return rocGraph;
    }

    public ROC setROCGraph(
        @org.jpmml.model.annotations.Property("rocGraph")
        ROCGraph rocGraph) {
        this.rocGraph = rocGraph;
        return this;
    }

    @Override
    public VisitorAction accept(Visitor visitor) {
        VisitorAction status = visitor.visit(this);
        if (status == VisitorAction.CONTINUE) {
            visitor.pushParent(this);
            if ((status == VisitorAction.CONTINUE)&&hasExtensions()) {
                status = org.dmg.pmml.PMMLObject.traverse(visitor, getExtensions());
            }
            if (status == VisitorAction.CONTINUE) {
                status = org.dmg.pmml.PMMLObject.traverse(visitor, getROCGraph());
            }
            visitor.popParent();
        }
        if (status == VisitorAction.TERMINATE) {
            return VisitorAction.TERMINATE;
        }
        return VisitorAction.CONTINUE;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy