q2-classo Parameter Reference#
Every parameter of every registered q2-classo action, with its CLI spelling,
its type as registered with QIIME 2, its default as declared in the function
signature, and the chapter where the tutorial exercises it.
regress and classify carry most of the surface area — 36 and 34 registered
parameters respectively — and almost none of them describe the model itself.
They describe the four model-selection procedures c-lasso can run on the same
fitted path: PATH, CV, StabSel and LAMfixed. Each procedure has its own prefix,
its own on/off switch, and its own numerical method.
Use Troubleshooting when a flag misbehaves, and Command Coverage Matrix for which actions the tutorial covers.
Important
These tables are maintained by hand and can drift away from the plugin. The
intended end state is to capture qiime classo <action> --help into
docs/_data/help/classo-<action>.txt at build time, render it with
{literalinclude}, and add a CI check that asserts the documented parameter set
equals the set registered in q2_classo/plugin_setup.py and
q2_classo/_dict.py. That generation step is not wired up yet. Until it is,
treat --help on your own install as the final authority, and open an issue
where this page disagrees with it.
Note
Every name, type and default below was read from q2_classo/plugin_setup.py,
q2_classo/_dict.py and the function signatures in q2_classo/_func.py. They
have not yet been checked against captured --help output from a QIIME 2 2026.7
build, because that environment does not exist yet.
Flag spelling and table conventions#
QIIME 2 derives every CLI flag mechanically: a parameter foo_bar becomes
--p-foo-bar, an input --i-foo-bar, an output --o-foo-bar, a Metadata
parameter --m-foo-bar-file, and a MetadataColumn parameter the pair
--m-foo-bar-file plus --m-foo-bar-column. Underscores are not collapsed,
which is why the deprecated cv__nlam surfaces as --p-cv--nlam with two
dashes.
Conventions in the Notes column:
deprecated — still accepted, emits a
DeprecationWarning, will be removed.no
Choices()— the plugin does not constrain the accepted strings; see String parameters have no validation below.
The Demonstrated in column names the chapter that exercises the parameter,
or the closest chapter that discusses it. not demonstrated means the parameter
is never passed in a runnable command in this tutorial — it may still be
discussed in prose or listed in a chapter’s own parameter table. It says nothing
about whether the parameter works.
generate-data#
Builds a synthetic log-contrast problem with a known ground-truth support. Use it to check that your invocation works before you point it at real data.
Name |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
|
If given, feature labels are drawn from the taxonomy and a tree matrix is built. |
|
|
|
|
|
Number of samples. |
|
|
|
|
|
Number of features. |
|
|
|
|
|
Size of the true support. |
|
|
|
|
|
When |
|
|
|
|
required |
||
|
|
|
required |
Zero-sum constraint. |
Important
Known bug: generate-data writes randomy.tsv into your current working
directory. The generated response vector is not returned as an artifact. The
action writes it to a fixed relative path as a side effect. Run this action from
a directory you do not mind writing into, and expect the file to be overwritten
on every call. The response you then pass to regress comes from that file.
transform-features#
Name |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
||
|
|
|
|
|
|
|
|
|
|
Pseudocount substituted for non-positive entries before the log. |
|
|
|
|
required |
This is a different CLR implementation from
qiime gglasso transform-features: it takes a
coef rather than a pseudo_count, has no mclr option, has no metadata
handling, and preserves the orientation it is given, centring along rows — it
assumes samples in rows, which is what the QIIME 2 FeatureTable view supplies
and what regress expects. It does not transpose, so a feature-major input is
silently CLR-ed along the wrong axis. The two are not interchangeable.
add-taxa#
Replaces the feature matrix log(X) with log(X)A, where A encodes the
taxonomic tree — the change of basis that turns a plain log-contrast model into
trac.
Name |
CLI flag |
Type |
Notes |
|---|---|---|---|
|
|
|
|
|
|
|
Optional; defaults to the all-ones vector. |
|
|
|
Converted to a tree internally. |
|
|
|
Columns are now internal nodes plus leaves. |
|
|
|
Each node’s weight divided by its number of leaves. |
The action has no parameters. The leaf-count rescaling of the weights makes coarse taxonomic ranks comparable with fine ones, and it is not optional.
add-covariates#
Appends metadata columns to the feature matrix and extends the constraint matrix and weight vector to match. A covariate added this way enters the model without being subject to the zero-sum constraint.
Name |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
|
Registered as optional, but required in practice — see the note below. |
|
|
|
|
|
Genuinely optional; falls back to an all-ones constraint row. |
|
|
|
|
|
Defaults to all ones, length = number of features. |
|
|
|
|
required |
The metadata file the columns come from. |
|
|
|
|
required |
Column names to append; repeat the flag once per column. |
|
|
|
|
|
One value per entry of |
|
|
|
|
|
Penalty weight per added covariate; same length rule. Defaults to all |
|
|
|
|
required |
||
|
|
|
required |
Zeros in the new columns, i.e. the added covariates are exempt from the constraint. |
|
|
|
|
required |
Note
--i-features and --i-c are both registered as optional inputs (--help
prints [optional] for both), but only --i-c is genuinely optional: omitting
it falls back to an all-ones constraint row. Omitting --i-features fails with
AttributeError: 'NoneType' object has no attribute 'columns' rather than a CLI
usage error, so treat it as required. Only --m-covariates-file and
--p-to-add are marked [required].
Two behaviours affect the design matrix this action produces:
Categorical columns. These are one-hot expanded, and the generated column
labels have the form <name> = <value> — with spaces around the equals sign.
Those labels appear in the summarize coefficient plots, so a categorical
covariate contributes several rows to the output, not one.
Rescaling. rescale applies to numeric columns only, where it centres the
column and divides by its norm. The log-contrast features are CLR values of
order one, so an unrescaled covariate measured in metres or in cells per gram
will dominate or vanish relative to them under a shared penalty. Setting the
corresponding w_to_add entry is the other lever on the same problem.
regress#
Constrained sparse log-contrast regression. 36 registered parameters: 35 current plus one deprecated alias.
Inputs and outputs#
Name |
CLI flag |
Type |
Notes |
|---|---|---|---|
|
|
|
Samples in rows. |
|
|
|
Defaults to the zero-sum constraint when omitted. |
|
|
|
Per-feature penalty weights. Shorter than the feature count is padded with ones; longer is truncated. |
|
|
|
Zarr store with every model selection that was run. |
Response and formulation#
These six choose the loss and the constraint structure — the statistical model itself. The parameters that follow affect only how lambda is chosen.
Parameter |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
Samples missing from |
|
|
|
|
|
Centres |
|
|
|
|
|
Joint M-estimation of the noise level sigma. Not present on |
|
|
|
|
|
Robust loss; combine with |
|
|
|
|
|
Huber transition point. Only meaningful when |
|
|
|
|
|
Adds an unpenalised intercept, which appears in the output as a coefficient labelled |
Set concomitant deliberately rather than inheriting its default of True. It
estimates sigma jointly with beta, which makes the selected lambda scale-free
with respect to the noise level — desirable, but it also changes which numerical
methods are available and therefore what *_numerical_method can legally be.
PATH parameters#
Computes the full regularization path. On by default.
Parameter |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
|
Registered default is |
|
|
|
|
|
not demonstrated |
|
|
|
|
|
Stop once this many variables are active. |
|
|
|
|
|
Number of lambdas on the log-spaced path. |
|
|
|
|
|
Smallest lambda as a fraction of lambda_max. |
CV parameters#
K-fold cross-validation over the path. On by default.
Parameter |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
|
||
|
|
|
|
not demonstrated |
As |
|
|
|
|
Fold assignment seed. Fixed by default, so repeated runs agree — change it to check fold stability. |
|
|
|
|
|
Select lambda by the one-standard-error rule rather than the CV minimum. |
|
|
|
|
|
Number of folds. |
|
|
|
|
|
Lambdas on the CV path. Current spelling. |
|
|
|
|
|
Deprecated alias of |
|
|
|
|
|
Smallest lambda on the CV path. |
|
|
|
|
|
Log-spaced CV path. |
Note
--p-cv-nlam and --p-cv-lamin define a separate grid from --p-path-nlam-log
and --p-path-lamin-log. Changing the PATH grid does not change what CV
searches over, so the CV-selected lambda can be absent from the plotted path.
Important
Open docs issue. The only runnable commands that pass this grid’s size use
the deprecated spelling: Cross-Validation
invokes --p-cv--nlam, not --p-cv-nlam. Rule 5 of
Command Coverage Matrix says --p-cv--nlam must not
appear in a runnable command outside the quarantined chapters. Migrate those two
commands to --p-cv-nlam.
StabSel parameters#
Stability selection: refit on many subsamples and keep the features selected often enough. On by default, and generally the most trustworthy of the four procedures for microbiome data.
Parameter |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
|
||
|
|
|
|
not demonstrated |
As above. No |
|
|
|
|
Unlike |
|
|
|
|
|
|
|
|
|
|
|
not demonstrated |
Only used when |
|
|
|
|
not demonstrated |
Only used when |
|
|
|
|
Number of subsamples. The main runtime knob of the whole action. |
|
|
|
|
|
Variables selected per subsample. |
|
|
|
|
|
Subsample size as a fraction of n. |
|
|
|
|
|
not demonstrated |
Only used when |
|
|
|
|
Selection frequency above which a feature is reported as selected. |
|
|
|
|
|
Frequency above which a feature is labelled in c-lasso’s own matplotlib plot. Recorded in the artifact; not used by the QIIME 2 visualization. |
stabsel_b, stabsel_q and stabsel_threshold interact. Raising q makes each
subsample select more variables, which raises every feature’s selection
frequency, so a threshold that was strict at q=10 becomes permissive at
q=30. Change one at a time, and report all three alongside any selected feature
set.
LAMfixed parameters#
A single fit at one fixed lambda. On by default.
Parameter |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
|
||
|
|
|
|
not demonstrated |
As above. No |
|
|
|
|
Negative means “use the theoretical lambda once it is computed”. |
|
|
|
|
|
|
Tip
All four procedures default to on, so a bare qiime classo regress runs PATH,
CV, StabSel and LAMfixed in one call. StabSel refits the model stabsel_b times
(50 by default) and usually dominates the cost. Turn off what you are not going
to read: --p-cv False, --p-stabsel False, --p-lamfixed False.
Note
--help misreports several of these defaults. QIIME 2 renders the
registered description text verbatim, so --help contradicts its own
[default: ...] marker wherever the description in q2_classo/_dict.py has
drifted from the function signature. In every case below the marker is right and
the description is wrong. The tables above follow the signatures.
Parameter |
|
Signature default |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classify#
Constrained sparse classification. 34 registered parameters: 33 current plus the
same deprecated cv__nlam alias.
The PATH, CV, StabSel and LAMfixed blocks are identical to regress: same names,
same types, same defaults. Read the four tables above and substitute classify
for regress.
Inputs and outputs#
Identical to regress: --i-features, --i-c, --i-weights, --o-result.
Differences from regress#
Parameter |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
Categorical, not numeric. Must be binary; a non-binary column is rejected. |
|
|
|
|
|
Huber hinge loss. |
|
|
|
|
|
Different default from |
|
|
|
|
|
||
|
— |
— |
— |
— |
Does not exist on |
|
— |
— |
— |
— |
Does not exist on |
Important
qiime classo classify --p-concomitant does not exist. The concomitant
formulation is unavailable for classification: the parameter is not registered,
and the solver forces formulation.concomitant = False for classification
problems regardless. Passing the flag is a CLI error, not a silently ignored
option.
If you want the robustness that motivated concomitant, use the Huber hinge
loss instead — --p-huber True, tuned via --p-rho. rho defaults to 0.0
here rather than 1.345 — it is wired to c-lasso’s
formulation.rho_classification, a different field from regress’s
formulation.rho, and 0.0 is a legal value for it (c-lasso requires only that
it be strictly less than 1). The --help text for classify reports 1.345
(_dict.py:286) and is wrong. The registered default is 0.0, which is what
every worked classify command in this book runs with. See
Concomitant Formulation.
predict#
Name |
CLI flag |
Type |
Notes |
|---|---|---|---|
|
|
|
Columns are matched to the fitted model by label; an |
|
|
|
Output of |
|
|
|
One prediction set per model selection that was computed. |
The action has no parameters. It emits a prediction for every model selection
present in problem, so if you turned off CV and StabSel at fit time you get
correspondingly fewer prediction sets here.
summarize (visualizer)#
Name |
CLI flag |
Type |
Default |
Demonstrated in |
Notes |
|---|---|---|---|---|---|
|
|
|
required |
||
|
|
|
|
Used to label coefficients taxonomically. |
|
|
|
|
|
Output of |
|
|
|
|
|
Maximum number of coefficients drawn in a StabSel profile or beta bar plot. Raise it on wide problems or the plot silently truncates. |
String parameters have no validation#
q2_classo/plugin_setup.py imports Choices but never applies it. QIIME 2
therefore accepts any string for the parameters below, and the check — if there
is one — happens inside the function:
Flag |
Accepted values |
Behaviour on a typo |
|---|---|---|
|
|
|
|
|
Silently accepted — the default is itself the unrecognised literal |
|
same set |
Silently accepted |
|
same set |
Silently accepted |
|
same set |
Silently accepted |
|
|
Reaches c-lasso; behaviour depends on the solver |
The *_numerical_method family is the dangerous one. Because the sentinel
default is not a valid method name, there is no way for the code to distinguish
“user asked for automatic selection” from “user misspelled Path-Alg” — both are
strings outside the recognised set, and both fall through to automatic
selection. You will get an answer, and it will not be the method you asked for.