Package: doenut
Design of Experiments Numerical Utility Toolkit DoENUTPackage to conveniently combine all necessary functions required to do Design of Experiments.Code for a forthcoming paper:
"DoENUT: Design of Experiments Numerical Utility Toolbox, for use in research and teaching," Ella M. GaleAlso has tutorials and examplesAboutA python module to do DoE from start to
finish for the main methodologies used by chemists and thus
explain the methods of DoE to the interested chemist.Design of experiments[1] (DoE) is a technique widely used in industry
to optimise processes, formulations and materials or to
quickly explore chemical space. The standard approach to scientific
research is theone variable at a time(OVAT), where a single variable
is changed and the effect measured, or the related ‘trail and error’
approach where an experimentor does repeated OVAT experiments to
understand a process. DoE changes more than one variable at a time, and
uses regression to fit simple models to the data, which shows up where
there is interaction between factors, which can improve (synergistic) or
reduce (antagonistic) outcomes. DoE is commonly used to optimise a
process. The DoE method is:identify all possible factors that could affect an
experiment/process deciding which ones to investigatesetting up a series of experiments to fully explore the variable
landscape by changing more than one variable at a timeincluding repeat experiments to get a measure of the variance in the
datausing multi-variate linear regression to fit models to the datausing leave one out approaches to test the predictability of the
modelsusing cost terms (often associated with the number of terms in the
modelchoosing the best model using predictability and costusing the model to predict which area of variable space to explore
next to continue to optimise.There are several software programs to make this easy (e.g. Modde,SAS etc). For example, in optimsing a new recipie for Pringles (a
type of potatoe based chip) that reduced the amount of potato flour by
including rice, corn and wheat flour, Kelloggs performed a DoE with the
constraints that the potato flour content must be at least 40% and that
the water content must be 40%, but the amount of other flours were
varied simultaneously. DoE experimentation tends to give some
understanding as to what is important in a system, and has the advantage
over OVAT that you know exactly how many experiments you will need to do
a priori. Giving the requirement for several experiments, DoE approaches
go very well with automated synthesis machines (like ChemSpeed etc),
allowing for easy gathering of data.[1] Also called ‘experimental design’ and ‘statistical experimental
design’InstallationThe easiest way is via pippip install doenut.Alternatively, get the source and use poetry viapoetry installGetting startedAs a very quick start, assuming your data is split into a pair of pandas
DataFrames, one for the input data and one for the responses, the following
code will create a standard model and generate some stats on how good it is.dataset=doenut.data.ModifiableDataSet(inputs,responses)model=doenut.models.AveragedModel(dataset)r2,q2=model.r2,model.q2print(f"R2 is{r2}, Q2 is{q2}")doenut.plot.plot_summary_of_fit_small(r2,q2)doenut.plot.coeff_plot(model.coeffs,labels=list(dataset.get().inputs.columns),errors='p95',normalise=True)For a more comprehensive look, open up a workbook in Tutorials.