Skip to content

Parameter relevance charts

daspi.plotlib.precast.ParameterRelevanceCharts(linear_model, drop_intercept=True, stretch_figsize=False)

Bases: JointChart

Provides a set of charts for visualizing the relevance of a linear regression model's parameters.

The ParameterRelevanceCharts class takes a LinearModel instance and generates a set of two charts for visualizing the relevance of the model's parameters: - Pareto chart of the parameter standardized effects - Pareto chart of the Sum of Squares for each parameter

On the first chart, the standardized effect of each parameter is visualized as a Pareto chart. The red line indicates the alpha level of significance.

PARAMETER DESCRIPTION
linear_model

The linear regression model whose parameters will be visualized.

TYPE: LinearModel

drop_intercept

Whether to drop the intercept from the model, by default True.

TYPE: bool DEFAULT: True

stretch_figsize

If True, the height and width of the figure are stretched based on the number rows and columns in the axes grid. If a float is provided, the figure size is stretched by the given factor. If a tuple of two floats is provided, the figure size is stretched by the given factors for the x and y axis, respectively. by default False.

TYPE: bool | float | Tuple[float, float] DEFAULT: False

Examples:

import daspi as dsp
import pandas as pd

df = dsp.load_dataset('painkillers-dissolution')
model = dsp.LinearModel(
    source=df,
    target='dissolution',
    features=['employee', 'stirrer', 'brand', 'catalyst', 'water'],
    covariates=['temperature', 'preparation'],
    order=2)
df_gof = pd.concat(model.recursive_elimination())
dsp.ParameterRelevanceCharts(model).plot().stripes().label(info=True)

ParameterRelevanceChartsDocstringExample

lm = linear_model instance-attribute

The linear regression model whose parameters are visualized.

plot()

Generates a set of two charts for visualizing the relevance of the model's parameters: - Pareto chart of the parameter standardized effects - Pareto chart of the Sum of Squares for each parameter

RETURNS DESCRIPTION
Self

The ParameterRelevanceCharts instance, for method chaining.

TYPE:

Notes

The plot() method will generate two charts. The first chart will contain the Pareto chart of the parameter standardized effects. The second chart will contain the Pareto chart of the Sum of Squares for each parameter.

The red line in the Pareto charts represents the threshold for the effect of a parameter. The threshold is calculated as the alpha risk where the parameter is not relevant.

stripes()

Adds a line at position 0 for each subplot except for the probability plot. This line represents the fit of the model.

label(info=False, **kwds)

Adds titles and labels to the charts generated by the plot() method.

PARAMETER DESCRIPTION
info

If True, the method will add an informative subtitle to the chart. If a string is provided, it will be used as the subtitle, by default False.

TYPE: bool | str DEFAULT: False

**kwds

Additional keyword arguments to be passed to the label() method of the JointChart instance.

DEFAULT: {}

RETURNS DESCRIPTION
Self

The ParameterRelevanceCharts instance, for method chaining.