# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

"""otpmml module"""

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _otpmml
else:
    import _otpmml

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


import openturns.base
import openturns.common
import openturns.typ
import openturns.statistics
import openturns.graph
import openturns.func
import openturns.geom
import openturns.iterative_statistics
import openturns.diff
import openturns.optim
import openturns.experiment
import openturns.solver
import openturns.algo
import openturns.uncertainty
import openturns.model_copula
import openturns.randomvector
import openturns.dist_bundle1
import openturns.dist_bundle2
import openturns.weightedexperiment
import openturns.classification
import openturns.orthogonalbasis
import openturns.metamodel
import openturns.transformation
import openturns.analytical
import openturns.simulation
import openturns.stattests
import openturns.model_process
import openturns.dist_bundle3
class SamplePersistentCollection(openturns.common.PersistentObject, openturns.typ.SampleCollection):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def getClassName(self):
        r"""
        Accessor to the object's name.

        Returns
        -------
        class_name : str
            The object class name (`object.__class__.__name__`).
        """
        return _otpmml.SamplePersistentCollection_getClassName(self)

    def __init__(self, *args):
        _otpmml.SamplePersistentCollection_swiginit(self, _otpmml.new_SamplePersistentCollection(*args))

    def __repr__(self):
        return _otpmml.SamplePersistentCollection___repr__(self)

    def __str__(self, *args):
        return _otpmml.SamplePersistentCollection___str__(self, *args)
    __swig_destroy__ = _otpmml.delete_SamplePersistentCollection

# Register SamplePersistentCollection in _otpmml:
_otpmml.SamplePersistentCollection_swigregister(SamplePersistentCollection)

class DAT(openturns.common.Object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def getClassName(self):
        r"""
        Accessor to the object's name.

        Returns
        -------
        class_name : str
            The object class name (`object.__class__.__name__`).
        """
        return _otpmml.DAT_getClassName(self)

    @staticmethod
    def Import(datFile):
        r"""
        Import data from `dat` file

        Parameters
        ----------
        filename: string
            file that contains data

        Returns
        -------
        coll : collection
            Collection of Sample, of size 2
            Usually first sample corresponds to input data, second one to output

        Examples
        --------
        >>> import openturns as ot
        >>> import otpmml
        >>> # import collection
        >>> coll = DAT.Import('myData.dat')
        >>> # Get first and second samples
        >>> inputSample, outputSample = tuple(coll)
        """
        return _otpmml.DAT_Import(datFile)

    @staticmethod
    def Export(*args):
        r"""
        Export data to `dat` file

        Usage
        -----
          DAT.Export(filename, inputSample, outputSample)
          DAT.Export(filename, inputSample)

        Parameters
        ----------
        filename: string
            file that contains data

        inputSample: :class:`~openturns.Sample` or 2d-array like
            Corresponds to input data

        outputSample: :class:`~openturns.Sample` or 2d-array like
            Corresponds to output data

        Examples
        --------
        >>> import openturns as ot
        >>> import otpmml
        >>> # Generate samples
        >>> inputSample = ot.Normal(2).getSample(10)
        >>> outputSample = ot.Function(['x',y'], ['x+y'])(inputSample)
        >>> DAT.Export('myData.dat', inputSample, outputSample)
        """
        return _otpmml.DAT_Export(*args)
    __swig_destroy__ = _otpmml.delete_DAT

# Register DAT in _otpmml:
_otpmml.DAT_swigregister(DAT)

def DAT_Import(datFile):
    r"""
    Import data from `dat` file

    Parameters
    ----------
    filename: string
        file that contains data

    Returns
    -------
    coll : collection
        Collection of Sample, of size 2
        Usually first sample corresponds to input data, second one to output

    Examples
    --------
    >>> import openturns as ot
    >>> import otpmml
    >>> # import collection
    >>> coll = DAT.Import('myData.dat')
    >>> # Get first and second samples
    >>> inputSample, outputSample = tuple(coll)
    """
    return _otpmml.DAT_Import(datFile)

def DAT_Export(*args):
    r"""
    Export data to `dat` file

    Usage
    -----
      DAT.Export(filename, inputSample, outputSample)
      DAT.Export(filename, inputSample)

    Parameters
    ----------
    filename: string
        file that contains data

    inputSample: :class:`~openturns.Sample` or 2d-array like
        Corresponds to input data

    outputSample: :class:`~openturns.Sample` or 2d-array like
        Corresponds to output data

    Examples
    --------
    >>> import openturns as ot
    >>> import otpmml
    >>> # Generate samples
    >>> inputSample = ot.Normal(2).getSample(10)
    >>> outputSample = ot.Function(['x',y'], ['x+y'])(inputSample)
    >>> DAT.Export('myData.dat', inputSample, outputSample)
    """
    return _otpmml.DAT_Export(*args)

class RegressionModel(openturns.common.PersistentObject):
    r"""
    The class enables to build a regression model from a PMML file.

    Usage
    ------
        model = RegressionModel(filename)
        model = RegressionModel(myLinearLeastSquares)

    Parameters
    ----------
    filename : string
        PMML file that contains the regression model

    myLinearLeastSquares: LinearLeastSquares
        Countains the algorithm for solving linear least squares.

    Examples
    --------
    import openturns as ot
    import otpmml
    model = otpmml.RegressionModel('myRModel.pmml')
    """

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def getLinearLeastSquares(self):
        r"""
        The method returns the LinearLeastSquares arguments

        Returns
        -------
        model : LinearLeastSquares
            Openturns class for linear regression model

        Examples
        --------
        >>> import openturns as ot
        >>> import otpmml
        >>> model = otpmml.RegressionModel('myRModel.pmml')
        >>> linearModel = model.getLinearLeastSquares()
        """
        return _otpmml.RegressionModel_getLinearLeastSquares(self)

    def exportToPMMLFile(self, pmmlFile):
        r"""
        The method exports the model into a PMML file

        Parameters
        -----------
        filename : string
            PMML File for export.

        Examples
        --------
        >>> import openturns as ot
        >>> import otpmml
        >>> model = otpmml.RegressionModel('myRModel.pmml')
        >>> model.exportToPMMLFile('myModel.pmml')

        """
        return _otpmml.RegressionModel_exportToPMMLFile(self, pmmlFile)

    def __repr__(self):
        return _otpmml.RegressionModel___repr__(self)

    def __init__(self, *args):
        _otpmml.RegressionModel_swiginit(self, _otpmml.new_RegressionModel(*args))
    __swig_destroy__ = _otpmml.delete_RegressionModel

# Register RegressionModel in _otpmml:
_otpmml.RegressionModel_swigregister(RegressionModel)

class NeuralNetwork(openturns.func.Function):
    r"""

    The class enables to build a neural network model from a PMML file.

    Usage
    ------
        model = NeuralNetwork('myNNModel.pmml')

    Parameters
    ----------
    filename : string
        PMML file that contains the neural network model

    Examples
    --------
    >>> import openturns as ot
    >>> import otpmml
    >>> # load model
    >>> model = otpmml.NeuralNetwork('myNNModel.pmml')

    Notes
    ------
    The result object is of type Function.

    """

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def getClassName(self):
        r"""
        Accessor to the object's name.

        Returns
        -------
        class_name : str
            The object class name (`object.__class__.__name__`).
        """
        return _otpmml.NeuralNetwork_getClassName(self)

    def __repr__(self):
        return _otpmml.NeuralNetwork___repr__(self)

    def __str__(self, *args):
        return _otpmml.NeuralNetwork___str__(self, *args)

    def __init__(self, *args):
        _otpmml.NeuralNetwork_swiginit(self, _otpmml.new_NeuralNetwork(*args))
    __swig_destroy__ = _otpmml.delete_NeuralNetwork

# Register NeuralNetwork in _otpmml:
_otpmml.NeuralNetwork_swigregister(NeuralNetwork)



