# Path: gptwosample/data/data_base.py
# def get_training_data_structure(x1, x2, y1, y2):
# def get_model_structure(individual=None, common=None):
# def has_model_structure(structure):
#     def __init__(self, *args, **kwargs):
# class DataStructureError(TypeError):


from pygp.covar.combinators import SumCF
from pygp.covar.noise import NoiseCFISO
from pygp.covar.se import SqexpCFARD
from pygp.gp.gpcEP import GPCEP
from gptwosample.data.data_base import common_id, individual_id
import scipy as SP

class TwoSampleIntervalSmooth(object):
    '''
    Sample each x point by gibbs sampling, smoothing indicators by gpcEP with ProbitLikelihood.
    '''
    def __init__(self, twosample_object, indicator_prior = .3, outlier_probability=.1):
        '''
        Predict probability of an input point of twosample_object is more likely
        described by shared or individual model, respectivel. This class
        learns all hyperparameters needed for Gaussian Process Regression.
        
        NOTE: Shapes of inputs of models must agree, otherwise we cannot gibbs sample over them!

        
        **Parameters:**
        
        twosample_object : :py:class:`gptwosample.twosample.GPTwoSample`
            GPTwoSample object to predict for
            
        outlier_probability : probability
            Probability for an input point to be an outlier (for robust
            output_prediction)
        '''
        # save static objects and values:
        self._twosample_object = twosample_object
        self.outlier_probability = outlier_probability
        
        # All x-values, which are given by twosample_object
        self._input_comm = twosample_object.get_data(common_id)[0]
        self._input_ind2 = twosample_object.get_data(individual_id,0)[0]

# Path: gptwosample/data/data_base.py
# def get_training_data_structure(x1, x2, y1, y2):
# def get_model_structure(individual=None, common=None):
# def has_model_structure(structure):
#     def __init__(self, *args, **kwargs):
# class DataStructureError(TypeError):


# Path: gptwosample/twosample/interval_smooth.py
from pygp.covar.combinators import SumCF
from pygp.covar.noise import NoiseCFISO
from pygp.covar.se import SqexpCFARD
from pygp.gp.gpcEP import GPCEP
from gptwosample.data.data_base import common_id, individual_id
import scipy as SP


class TwoSampleIntervalSmooth(object):
    '''
    Sample each x point by gibbs sampling, smoothing indicators by gpcEP with ProbitLikelihood.
    '''
    def __init__(self, twosample_object, indicator_prior = .3, outlier_probability=.1):
        '''
        Predict probability of an input point of twosample_object is more likely
        described by shared or individual model, respectivel. This class
        learns all hyperparameters needed for Gaussian Process Regression.
        
        NOTE: Shapes of inputs of models must agree, otherwise we cannot gibbs sample over them!

        
        **Parameters:**
        
        twosample_object : :py:class:`gptwosample.twosample.GPTwoSample`
            GPTwoSample object to predict for
            
        outlier_probability : probability
            Probability for an input point to be an outlier (for robust
            output_prediction)
        '''
        # save static objects and values:
        self._twosample_object = twosample_object
        self.outlier_probability = outlier_probability
        
        # All x-values, which are given by twosample_object
        self._input_comm = twosample_object.get_data(common_id)[0]
        self._input_ind2 = twosample_object.get_data(individual_id,0)[0]

        self._input_ind1 = twosample_object.get_data(individual_id,1)[0]