81db009a1cc919bfda48bb923e3caa70c1dfeb9e,elfi/bo/gpy_model.py,GPyModel,_check_input,#GPyModel#Any#Any#,136

Before Change


        if not isinstance(X, np.ndarray) or not isinstance(Y, np.ndarray) or len(X.shape) > 2 or len(Y.shape) > 2:
            raise ValueError("Observation arrays X and Y must be 2d numpy arrays (X type=%s, Y type=%s)" % (type(X), type(Y)))
        X = np.atleast_2d(X)
        Y = np.atleast_2d(Y)
        for x in X:
            if not self._within_bounds(x):
                raise ValueError("Location %s was not within model bounds." % (x))
        if X.shape[0] != Y.shape[0]:

After Change


        if not isinstance(X, np.ndarray):
            raise ValueError("Type of X must be numpy.ndarray. " +
                    "Received type {}.".format(type(X)))
        if not isinstance(Y, np.ndarray):
            raise ValueError("Type of Y must be numpy.ndarray. " +
                    "Received type {}.".format(type(Y)))
        if len(X.shape) != 2 or X.shape[1] != self.input_dim:
            raise ValueError("Shape of X must be (n_obs, {}). ".format(self.input_dim) +
                    "Received shape {}.".format(X.shape))
        if len(Y.shape) != 2 or Y.shape[1] != 1:
            raise ValueError("Shape of Y must be (n_obs, {}). ".format(self.input_dim) +
                    "Received shape {}.".format(X.shape))
        if X.shape[0] != Y.shape[0]:
            raise ValueError("X and Y must contain equal number of observations " +
                    "(X.shape[0]={}, Y.shape[0]={}).".format(X.shape[0], Y.shape[0]))
        for x in X:
            if not self._within_bounds(x):
                raise ValueError("Location {} was not within model bounds.".format(x))
        return X, Y

    def update(self, X, Y):
        Add (X, Y) as observations, updates GP model.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: elfi-dev/elfi
Commit Name: 81db009a1cc919bfda48bb923e3caa70c1dfeb9e
Time: 2016-11-14
Author: antti.kangasraasio@hiit.fi
File Name: elfi/bo/gpy_model.py
Class Name: GPyModel
Method Name: _check_input


Project Name: scikit-learn-contrib/DESlib
Commit Name: ea513c769acc1826e4a3179ae3ab519fcef63140
Time: 2018-03-28
Author: rafaelmenelau@gmail.com
File Name: deslib/dcs/base.py
Class Name: DCS
Method Name: classify_instance


Project Name: dit/dit
Commit Name: 55f6f1ab292abe7a10a93982fa6df48f8d4c4854
Time: 2014-10-25
Author: chebee7i@gmail.com
File Name: dit/math/aitchison.py
Class Name:
Method Name: closure