FittedDensity
FittedDensity
¶
Bases: DensityCurve
Class for plotting a fitted probability density function (PDF) as a curve along the feature axis.
Unlike GaussianKDE, which always estimates the density
non-parametrically from the raw data and controls the curve width
via margin, this class fits (or assumes) a distribution to the
data according to strategy and evaluates its PDF. The width of
the curve is controlled by agreements instead of margin: the
curve spans the range between the quantiles corresponding to the
largest agreement value.
If strategy is (or evaluates to) 'data', no distribution is
fitted at all; the PDF/CDF is instead estimated directly from the
raw data using the same Gaussian kernel density estimation as
GaussianKDE, only the curve width is still controlled by
agreements rather than margin.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
Pandas long format DataFrame containing the data source for the plot.
TYPE:
|
target
|
Column name of the target variable for the plot.
TYPE:
|
feature
|
Column name of the feature variable for the plot, by default ''.
TYPE:
|
strategy
|
Which strategy should be used to fit/assume the distribution
whose PDF is evaluated, see
TYPE:
|
agreements
|
Specifies the tolerated process variation for calculating
quantiles. The largest agreement value also determines the
width of the plotted curve. See
TYPE:
|
possible_dists
|
Distributions to which the data may be subject, see
TYPE:
|
height
|
Height of the density curve at its maximum. If None, the curve is drawn using the real estimated probability (not normalized to a fixed height), by default None.
TYPE:
|
fill
|
Flag whether to fill in the curves, by default True
TYPE:
|
cumulative
|
If True, the cumulative distribution (CDF) is plotted instead of the density (PDF), by default False.
TYPE:
|
target_on_y
|
Flag indicating whether the target variable is plotted on the y-axis, by default True.
TYPE:
|
color
|
Color to be used to draw the artists. If None, the first color is taken from the color cycle, by default None.
TYPE:
|
ax
|
The axes object for the plot. If None, the current axes is
fetched using
TYPE:
|
visible_spines
|
Specifies which spines are visible, the others are hidden. If 'none', no spines are visible. If None, the spines are drawn according to the stylesheet. Defaults to None.
TYPE:
|
hide_axis
|
Specifies which axes should be hidden. If None, both axes are displayed. Defaults to None.
TYPE:
|
**kwds
|
Additional keyword arguments that have no effect and are only used to catch further arguments that have no use here (occurs when this class is used within chart objects).
DEFAULT:
|
kw_default
property
¶
Default keyword arguments for plotting (read-only)
estimate
¶
Evaluate the fitted/assumed distribution's PDF over the
range spanned by the largest agreements value.
estimate_cumulative
¶
Evaluate the fitted/assumed distribution's CDF directly
(analytically) over the range spanned by the largest
agreements value.