def plot_distribution(df, target, tag='eda', directory=None):
r"""Display a Distribution Plot.
Parameters
----------
df : pandas.DataFrame
The dataframe containing the ``target`` feature.
target : str
The target variable for the distribution plot.
tag : str
Unique identifier for the plot.
directory : str, optional
The full specification of the plot location.
Returns
-------
None : None.
References
----------
http://seaborn.pydata.org/generated/seaborn.distplot.html
"""
logger.info("Generating Distribution Plot")
# Generate the distribution plot
dist_plot = sns.distplot(df[target])
dist_fig = dist_plot.get_figure()
# Save the plot
write_plot('seaborn', dist_fig, 'distribution_plot', tag, directory)
#
# Function plot_box
#
评论列表
文章目录