plot_res_diagnostics
- pyoptex.analysis.utils.plot.plot_res_diagnostics(df, y_true='y', y_pred='pred', textcols=(), color=None)[source]
Plots the residual diagnostics of the fit. This plot contains four subplots in a 2-by-2 grid.
The upper left is the predicted vs. real plot. The black diagonal indicates the perfect fit.
The upper right is the predicted vs. error plot. This can indicate if there is any trend or correlation between the predictions and the random error (they should be uncorrelated).
The lower left is the quantile-quantile plot for a normal distribution of the errors. The black diagonal line indicates the perfect normal distribution of the errors.
The lower right is the run vs. error plot. For example, if the runs are ordered in time, this plot indicates if effects are missing. A trend indicates a time related component, or something which changed with time. An offset for certain blocks of consecutive runs may indicate a missing effect if using design of experiments with hard-to-change factors. Ideally, there are no trends or correlations.
Parameters
- dfpd.DataFrame
The dataframe with the data, output, and predictions.
- y_truestr
The name of the output column.
- y_predstr
The name of the prediction column.
- textcolslist(str) or tuple(str)
Any columns which should be added as text upon hover over the graph.
- colorstr
The column to group by with colors in the plot. Can be used to identify missing effects for the easy-to-change variables. Note that you any continuous variable should be binned.
Returns
- fig
plotly.graph_objects.Figure The plotly figure with the residual diagnostics.