How to use the xenonpy.pipeline._combinator.Just function in xenonpy

To help you get started, we’ve selected a few xenonpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yoshida-lab / XenonPy / xenonpy / pipeline / _combinator.py View on Github external
def __call__(self, *args, **kwargs):
            if not self.trained:
                if hasattr(self, 'fit_transform'):
                    self.trained = True
                    ret = self.fit_transform(*args, **kwargs)
                    return Just(ret) if not self.inv else ret
                if hasattr(self, 'fit'):
                    self.trained = True
                    self.fit(*args, **kwargs)
                    return Just(self) if not self.inv else self
                raise ValueError(
                    'combinator class must implement fit-transform/predict')
            if hasattr(self, 'predict'):
                ret = self.predict(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'transform'):
                ret = self.transform(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'draw'):
                ret = self.draw(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            raise ValueError(
github yoshida-lab / XenonPy / xenonpy / pipeline / _combinator.py View on Github external
def __call__(self, *args, **kwargs):
            if not self.trained:
                if hasattr(self, 'fit_transform'):
                    self.trained = True
                    ret = self.fit_transform(*args, **kwargs)
                    return Just(ret) if not self.inv else ret
                if hasattr(self, 'fit'):
                    self.trained = True
                    self.fit(*args, **kwargs)
                    return Just(self) if not self.inv else self
                raise ValueError(
                    'combinator class must implement fit-transform/predict')
            if hasattr(self, 'predict'):
                ret = self.predict(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'transform'):
                ret = self.transform(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'draw'):
                ret = self.draw(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            raise ValueError(
                'combinator class must implement fit-transform/predict')
github yoshida-lab / XenonPy / xenonpy / pipeline / _combinator.py View on Github external
return Just(ret) if not self.inv else ret
                if hasattr(self, 'fit'):
                    self.trained = True
                    self.fit(*args, **kwargs)
                    return Just(self) if not self.inv else self
                raise ValueError(
                    'combinator class must implement fit-transform/predict')
            if hasattr(self, 'predict'):
                ret = self.predict(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'transform'):
                ret = self.transform(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'draw'):
                ret = self.draw(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            raise ValueError(
                'combinator class must implement fit-transform/predict')
github yoshida-lab / XenonPy / xenonpy / pipeline / _combinator.py View on Github external
if hasattr(self, 'fit_transform'):
                    self.trained = True
                    ret = self.fit_transform(*args, **kwargs)
                    return Just(ret) if not self.inv else ret
                if hasattr(self, 'fit'):
                    self.trained = True
                    self.fit(*args, **kwargs)
                    return Just(self) if not self.inv else self
                raise ValueError(
                    'combinator class must implement fit-transform/predict')
            if hasattr(self, 'predict'):
                ret = self.predict(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'transform'):
                ret = self.transform(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'draw'):
                ret = self.draw(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            raise ValueError(
                'combinator class must implement fit-transform/predict')
github yoshida-lab / XenonPy / xenonpy / pipeline / _combinator.py View on Github external
def __call__(self, *args, **kwargs):
            if not self.trained:
                if hasattr(self, 'fit_transform'):
                    self.trained = True
                    ret = self.fit_transform(*args, **kwargs)
                    return Just(ret) if not self.inv else ret
                if hasattr(self, 'fit'):
                    self.trained = True
                    self.fit(*args, **kwargs)
                    return Just(self) if not self.inv else self
                raise ValueError(
                    'combinator class must implement fit-transform/predict')
            if hasattr(self, 'predict'):
                ret = self.predict(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'transform'):
                ret = self.transform(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            if hasattr(self, 'draw'):
                ret = self.draw(*args, **kwargs)
                return Just(ret) if not self.inv else ret
            raise ValueError(
                'combinator class must implement fit-transform/predict')
github yoshida-lab / XenonPy / xenonpy / pipeline / _combinator.py View on Github external
The Maybe monoid works when the values it contains are also monoids with a defined mzero and mplus.
        This allows you do things like::

            >>> Just(1) + Just(9) == Just(10)
            >>> Just("Hello ") + Just("World") == Just("Hello World")
            >>> Just([1, 2, 3]) + Just([4, 5, 6]) == Just([1, 2, 3, 4, 5, 6])

        The identity value is :class:`Nothing`::

            >>> Just(1) + Nothing == Just(1)
        """

        if other == Nothing:
            return self
        else:
            return Just(self.value + other.data_frame)
github yoshida-lab / XenonPy / xenonpy / pipeline / _combinator.py View on Github external
def __call__(self, *args, **kwargs):
            args_ = args + self.args
            kwargs_ = dict(kwargs, **self.kwargs)
            return Just(func(*args_, **kwargs_))