Design of Experiments · Python

From the first factor to the final report.

doetools builds the design, exports the run sheet your laboratory fills in, fits a model to each response, and maps the region of the domain where every specification holds at once. It runs inside the Python environment you already work in.

Licence MIT Cost Free Python 3.10+ Windows · macOS · Linux
Coal mill · 9 runsBoth specs met
14 t/h · 30% open Classifier Coal load (t/h)
Design points Fine particles Coarse particles

Y₁ = 76.90 − 4.84·X₁ − 5.60·X₂ + 1.84·X₁X₂ − 1.71·X₁² − 8.42·X₂²

Face-centred central composite design. Nine runs place the fitted surface within reach of both specifications; the marked point runs the mill at the highest load that still clears them. Data from Leardi, Anal. Chim. Acta 652 (2009) 161-172.

Why we wrote it

Open source, and still the whole study.

DoE software normally asks you to give up one of the two. We wanted a package that gave up neither, because our students and our clients kept running into the same wall.

Commercial platforms

They cover the study, at a price

  • One environment, from design generation to the report
  • Licence costs a student or a three-person laboratory cannot carry
  • Point-and-click analyses that are hard to version and rerun a year later
Python DoE packages

They are free, and they stop early

  • Installed in seconds, scripted like everything else in your pipeline
  • Most of them generate the design matrix and end there
  • Fitting, diagnostics and plotting are left for you to assemble

doetools covers both halves. MIT licence, one pip install, and a single design object that carries the matrix, the model terms, the measured responses, the fitted models and the diagnostics from the first line of code to the exported PDF.

The workflow

Eight steps, one object.

You create a design object from your factors. Every stage below is a method on that same object, so nothing has to be handed between libraries and nothing drifts out of sync.

01

Define the factors

Bounds, number of levels, discrete levels, mixture constraints. Each factor class carries what its design type needs.

ContinuousFactorCategoricalFactorMixtureFactor
02

Ask the advisor

Optional. Describe the study in five arguments and get back the design families that fit, each with its limits spelled out.

study phasemodel orderrun budgetconstraints
03

Generate the design

Build the matrix, or import one you already have. Replicates and centre points can be added afterwards.

processmixtureprocess-mixturereplicatescentre points
04

Set the model terms, then check the design

Choose the effects you want to estimate and see whether the design can estimate them, before anyone spends a week at the bench.

main effectsinteractionsquadraticSchefféleverageVIF
05

Export and run the experiments

The design leaves as a spreadsheet with the run order, the factor settings and empty response columns. Randomise the order on the way out.

.xlsx run sheetrandomisation
06

Import the responses

Type the measured values into the same file and read it back. Each run stays tied to its design point.

single responsemulti-response
07

Fit the models

Ordinary least squares, one model per response, with the coefficients, residuals and tests you need to decide whether to trust them.

OLSANOVAF-testslack of fitLOO-CV
08

Read the surface, export the report

Put a limit on each response and doetools shades the part of the domain that satisfies all of them, using the confidence bound instead of the mean prediction.

coefficient plotsresidualsresponse surfacesParetoPDF report
Supported designs

Each family is a shape in the factor space.

Below is what each one places in the domain, drawn from the point sets doetools generates. Filled markers are the runs you perform.

Factorial

Full factorial

Every combination of levels. All main effects and all interactions are estimable, and the run count doubles with each factor you add.

full factorial
Screening

Fractional and Plackett-Burman

Half the runs, or fewer. Some effects come back confounded with others, which is the price of ranking seven factors in eight experiments.

fractional factorialPlackett-Burman
Response surface

Box-Behnken and central composite

Edge midpoints and a centre point give a second-order model enough distinct levels to tell curvature apart from a straight line through the corners, and they keep every run off the extreme corners.

Box-BehnkenCCCCCFCCI
Mixture

Simplex and constrained mixture

Components sum to one, so the domain is a triangle rather than a square. Vertices are pure components, edges are binary blends, and the real formulations sit inside.

simplex centroidsimplex latticeconstrained
Optimal

D-optimal and augmentation

When a constraint cuts a corner off the domain, an exchange algorithm keeps the subset of candidate points that maximises the determinant of X'X.

D-optimalD-optimal augmentation
Existing experiments

Import your own matrix

Bring in a design generated elsewhere, or a set of runs already performed, and use the fitting, diagnostic and plotting methods on it.

import designspreadsheet
Design advisor

Which design, before which model.

Choosing the design is where most DoE studies go wrong, and it happens before any data exists. The advisor takes a short description of the study and returns the families that fit, with what each one will and will not give you.

Describe the study
suggestions = suggest_design(
    factors=factors,          # 5 continuous, 2 levels
    phase="screening",
    model_order="linear",
    max_experiments=10,
    constraints=False,
    performed_exp=False,
)

Five continuous variables at two levels, nothing run yet, no constraint on the domain, and the aim of ranking the main effects inside a budget of ten runs.

Read the recommendation
Design: Plackett-Burman Design
Number of runs: 8

Pros:
- Efficient main-effects screening design.
- Supports up to 7 factors in 8 runs.
- Well suited for rapid factor prioritization.

Cons:
- Does not estimate interaction effects.
- Main-effect estimates can be biased if
  interactions or curvature are relevant.

Note:
- Confirm the top factors with a
  higher-resolution design.
Install

One command, then import.

Pure Python, so it installs the same way on Windows, macOS and Linux, inside whichever environment you already use.

Install
python -m pip install \
  --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ \
  doetools

doetools sits on TestPyPI while the first public release is finalised. The extra index lets pip pull NumPy, SciPy and the rest of the dependencies from PyPI as usual.

Or work from source
git clone https://github.com/LorenzoTJ/doetools.git
cd doetools
uv venv .venv
uv sync --all-extras

Requirements

  • Python 3.10+
  • NumPy · pandas · SciPy
  • statsmodels
  • Plotly
Then start from your factors
# the design behind the plot at the top of this page
from doetools import ContinuousFactor as CF
from doetools import CentralCompositeDesign as CCD

factors = {
    "Load":       CF(n_levels=3, lower_bound=5, upper_bound=15),
    "Classifier": CF(n_levels=3, lower_bound=1, upper_bound=3),
}

design = CCD(factors=factors, center_points=1, design="ccf")

design.export_experiments(
    responses=["Y1", "Y2"],
    randomize=True,
    save_path="ccd_design.xlsx",
)

# run the 9 experiments, fill in the sheet, then
design.import_responses(file_path="ccd_responses.xlsx")
design.set_response_conditions(
    lower_limits=[70, None],
    upper_limits=[None, 1],
    maximize=[True, False],
)

Source and issue tracker: github.com/LorenzoTJ/doetools →

Documentation and citation

Everything you need to start, and to cite.

Documentation

doetools on Read the Docs

Installation, quick start, the API for every design class and workflow method, the mathematical background, and the full example gallery.

How to cite

Citing doetools

If doetools contributes to published work, cite the software and the exact version you used. GitHub generates the metadata from the repository's CITATION.cff.

An article describing doetools has been prepared for Chemometrics and Intelligent Laboratory Systems. The reference and DOI will appear here once available.

doetools was presented at ANALITICA 2026, XXXII Congresso Nazionale della Divisione di Chimica Analitica, Venezia Mestre, 7 September 2026.

Training and applied projects

From the package to your process.

doetools is free for everyone, and its public development follows what is useful to the whole community. When a study needs more than the library, DataBloom works alongside the laboratory: planning the campaign, adapting the analysis to the process, and training the people who will run it after we leave.

  • Experimental campaign planning
  • Process and formulation optimisation
  • Custom modules and dedicated workflows
  • DoE and chemometrics training
Support

Report a problem, or ask for something that is missing.

doetools is at 0.1.x and under active development. Bug reports, feature requests and teaching feedback all shape what goes into the next release.

GitHub

Issues

For bugs and feature requests that can be discussed in the open, tracked, and closed against a release.

Open an issue
Email

Write to us

For questions about applying doetools to a specific study, collaborations, and training or teaching material.

info@databloom.it

Released under the MIT Licence. Backward compatibility is not guaranteed until 1.0, and statistical output should be read together with the experimental context and the model assumptions.

Built by

Academic research and applied data science.

doetools is developed by the Department of Chemistry of the University of Turin together with DataBloom S.r.l., with contributions from the Department of Applied Science and Technology of Politecnico di Torino and from Chemometric Solutions.

University of Turin DataBloom

Lorenzo Teja · Giovanni Solarino · Alberto Mazzoleni · Alessandra Olarini · Ciro Orecchio · Nicola Cavallini · Marco Pazzi · Emanuele Farinini · Riccardo Leardi · Marco Vincenti · Eugenio Alladio