ó
‡ˆ\c           @   se   d  Z  d d l Z d d l m Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d	 ƒ d
 „  ƒ Z d S(   sK   
The built-in regression models submodule for the gaussian_process module.
iÿÿÿÿNi   (   t
   deprecatedsg   The function constant of regression_models is deprecated in version 0.19.1 and will be removed in 0.22.c         C   s>   t  j |  d t  j ƒ}  |  j d } t  j | d g ƒ } | S(   s‘  
    Zero order polynomial (constant, p = 1) regression model.

    x --> f(x) = 1

    Parameters
    ----------
    x : array_like
        An array with shape (n_eval, n_features) giving the locations x at
        which the regression model should be evaluated.

    Returns
    -------
    f : array_like
        An array with shape (n_eval, p) with the values of the regression
        model.
    t   dtypei    i   (   t   npt   asarrayt   float64t   shapet   ones(   t   xt   n_evalt   f(    (    sI   lib/python2.7/site-packages/sklearn/gaussian_process/regression_models.pyt   constant   s    se   The function linear of regression_models is deprecated in version 0.19.1 and will be removed in 0.22.c         C   sM   t  j |  d t  j ƒ}  |  j d } t  j t  j | d g ƒ |  g ƒ } | S(   s§  
    First order polynomial (linear, p = n+1) regression model.

    x --> f(x) = [ 1, x_1, ..., x_n ].T

    Parameters
    ----------
    x : array_like
        An array with shape (n_eval, n_features) giving the locations x at
        which the regression model should be evaluated.

    Returns
    -------
    f : array_like
        An array with shape (n_eval, p) with the values of the regression
        model.
    R   i    i   (   R   R   R   R   t   hstackR   (   R   R   R	   (    (    sI   lib/python2.7/site-packages/sklearn/gaussian_process/regression_models.pyt   linear*   s    $sh   The function quadratic of regression_models is deprecated in version 0.19.1 and will be removed in 0.22.c         C   s«   t  j |  d t  j ƒ}  |  j \ } } t  j t  j | d g ƒ |  g ƒ } xY t | ƒ D]K } t  j | |  d d … | t  j f |  d d … | d … f g ƒ } qX W| S(   s  
    Second order polynomial (quadratic, p = n*(n-1)/2+n+1) regression model.

    x --> f(x) = [ 1, { x_i, i = 1,...,n }, { x_i * x_j,  (i,j) = 1,...,n } ].T
                                                          i > j

    Parameters
    ----------
    x : array_like
        An array with shape (n_eval, n_features) giving the locations x at
        which the regression model should be evaluated.

    Returns
    -------
    f : array_like
        An array with shape (n_eval, p) with the values of the regression
        model.
    R   i   N(   R   R   R   R   R   R   t   ranget   newaxis(   R   R   t
   n_featuresR	   t   k(    (    sI   lib/python2.7/site-packages/sklearn/gaussian_process/regression_models.pyt	   quadraticD   s    $I(   t   __doc__t   numpyR   t   utilsR    R
   R   R   (    (    (    sI   lib/python2.7/site-packages/sklearn/gaussian_process/regression_models.pyt   <module>	   s
   