Methods¶
Find methods and see what each one needs. Every call works offline.
| Name | Summary |
|---|---|
mtb.find_methods |
Return the method ids that match every filter you pass. |
mtb.method_info |
Return everything known about one method as a dict. |
mtb.params_for |
Return the parameters of one method variant. |
mtb.find_methods
¶
find_methods(
category: str | None = None,
*,
modalities: list[str] | set[str] | None = None,
needs_labels: bool | None = None,
) -> list[str]
Return the method ids that match every filter you pass.
A method matches when one of its variants meets category,
modalities and needs_labels together.
| PARAMETERS | DESCRIPTION |
|---|---|
category
|
Integration category:
type
|
modalities
|
Modalities a variant must consume, e.g.
type
|
needs_labels
|
type
|
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
Method ids in the package's order. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
Unknown |
TypeError
|
|
Examples
>>> import multibench as mtb
>>> mtb.find_methods("vertical", modalities=["rna", "adt"])
>>> mtb.find_methods("vertical", modalities=["rna", "adt"], needs_labels=False)
See Also
mtb.method_info : the per-variant supports table these filters are read from.
mtb.scan : which of these methods can actually run on a given dataset.
mtb.method_info
¶
Return everything known about one method as a dict.
| PARAMETERS | DESCRIPTION |
|---|---|
method
|
Method id, e.g.
type
|
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
Unknown method id. |
Examples
>>> import multibench as mtb
>>> info = mtb.method_info("Matilda")
>>> # one entry per variant: category, modalities, labels ...
>>> info["supports"]
See Also
mtb.params_for : the parameters of one variant, with upstream defaults. mtb.find_methods : filter methods by category, modalities, labels, ATAC representation.
mtb.params_for
¶
params_for(
method: str,
category: str | None = None,
modalities: list[str] | set[str] | None = None,
) -> dict
Return the parameters of one method variant.
Call it before run(params=...) to see what a method accepts and
what it runs with when you pass nothing.
| PARAMETERS | DESCRIPTION |
|---|---|
method
|
Method id, e.g.
type
|
category
|
Integration category of the variant:
type
|
modalities
|
Modality tokens of the variant, e.g.
type
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
|
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
Unknown method, or no variant for |
ValueError
|
Unknown |
Examples
>>> import multibench as mtb
>>> p = mtb.params_for("Matilda", "vertical", ["rna", "adt"])
>>> p["tunable"]["epochs"]["default"]
30
See Also
mtb.run : takes these keys as params={method: {key: value}}.