U
    Ùf  ã                   @   s(   d dl mZ ddlZG dd„ deƒZdS )é   )Ú	Explaineré    Nc                   @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚCoefficentExplainerz± Simply returns the model coefficents as the feature attributions.

    This is only for benchmark comparisons and does not approximate SHAP values in a
    meaningful way.
    c                 C   s   t |dƒstdƒ‚|| _d S )NÚcoef_z1The passed model does not have a coef_ attribute!)ÚhasattrÚAssertionErrorÚmodel)Úselfr   © r
   úG/tmp/pip-target-lpfmz8o1/lib/python/shap/explainers/other/coefficent.pyÚ__init__
   s    zCoefficentExplainer.__init__c                 C   s   t  | jj|jd df¡S )Nr   é   )ÚnpZtiler   r   Úshape)r	   ÚXr
   r
   r   Úattributions   s    z CoefficentExplainer.attributionsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r
   r
   r
   r   r      s   r   )Z	explainerr   Únumpyr   r   r
   r
   r
   r   Ú<module>   s   