PDF Reports

get_model_summary_pdf() writes a static PDF summary of an experimental design and its fitted response models. Use it to archive an analysis or share a consistent report with collaborators. The report contains tables, diagnostic summaries, and statistical interpretations; it does not embed interactive Plotly figures or confirmation-run analysis.

Generating a report

The usual workflow is to create a design, define the model terms, export and perform the runs, import the measured responses, fit the model, and then write the report.

from doetools import CentralCompositeDesign, ContinuousFactor, ModelTerms

factors = {
    "Temperature": ContinuousFactor(n_levels=3, lower_bound=60, upper_bound=80),
    "Pressure": ContinuousFactor(n_levels=3, lower_bound=1, upper_bound=3),
}
design = CentralCompositeDesign(factors)

design.set_model_terms(
    ModelTerms(
        intercept=True,
        pro_main="all",
        pro_int2="all",
        pro_quadratic="all",
    )
)
design.export_experiments(
    responses=["Yield"],
    destination="design_matrix.xlsx",
)

# Perform the experiments, then import the completed workbook.
design.import_responses(source="completed_experiments.xlsx")
design.compute_mlr_model()

design.get_model_summary_pdf(filename="design_report.pdf")
DesignSummaryMixin.get_model_summary_pdf(filename='design_report.pdf')[source]

Write a static PDF summary of the design and fitted response models.

The report is assembled from the public summary getters. It includes design and factor information, model-matrix diagnostics, general diagnostics, and a separate analysis section for each fitted response.

Parameters:

filename (str) – Destination PDF path. The filename must end in ".pdf" and its parent directory must already exist. Defaults to "design_report.pdf" in the current directory.

Returns:

The report is written to filename.

Return type:

None

Raises:

ValueError – If the filename does not have a .pdf extension, the destination directory does not exist, or required design, model, response, or fitted-result data are unavailable.

Notes

Optional analyses, such as lack-of-fit, replicate summaries, VIF, predictions, and response conditions, are replaced by explanatory notices when unavailable. The report is written to a temporary file in the destination directory and replaces an existing destination only after successful generation.

Report contents

The report is organized as follows:

  • Design Overview — design type, run, replicate, center-point, and factor summaries. Process/categorical factors and mixture components are shown in separate tables.

  • Model Structure — requested included terms and effective model-matrix diagnostics: observations, columns, rank, aliased columns, intercept status, regression degrees of freedom, residual degrees of freedom, and model status.

  • General Diagnostics — VIF with a qualitative flag, run-level leverage and average leverage, and configured response conditions.

  • Response Analysis — one section per response with model metrics, coefficients, model and lack-of-fit F-tests with interpretations, ANOVA, replicate summary, and observed-versus-predicted values.

  • Report Notes — only when optional sections could not be populated.

  • Appendix A — the design matrix in actual factor units. It uses landscape pages and splits wide matrices into column groups while repeating the run column.