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d„Zdd„ ZdS )	ÚRandomExplainerzè Simply returns random (normally distributed) feature attributions.

    This is only for benchmark comparisons. It supports both fully random attributions and random
    attributions that are constant across all explainations.
    Fc                 C   s   || _ d | _d S )N)ÚconstantÚconstant_attributions)Úselfr   © r   úC/tmp/pip-target-lpfmz8o1/lib/python/shap/explainers/other/random.pyÚ__init__
   s    zRandomExplainer.__init__c                 C   sN   | j r<| jd kr$tj |jd ¡| _t | j|jd df¡S tjj|jŽ S d S )Né   r   )r   r   ÚnpÚrandomZrandnÚshapeZtile)r   ÚXr   r   r	   Úattributions   s
    
zRandomExplainer.attributionsN)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r   r	   r      s   
r   )Z	explainerr   Únumpyr   r   r   r   r   r	   Ú<module>   s   