arcade.classifiers
ARCADE classifiers.
- class arcade.classifiers.BaseClassifier[source]
Bases:
ABCContract every ARCADE discriminator must satisfy.
Class attributes control how the pipeline builds features and trains:
FEATURE_KIND— which feature matrix the classify stage builds (filter_features,iq_trace, …).CATEGORY—classical·neural·hybrid·ensemble.REQUIRES_NN_CONFIG— if true, YAML must supplyconfig_file/ NN dict.CLASSIFICATION_MODE— joint vs per-qubit decoding hints for metrics.
Subclass, set those attributes, implement
fit()/predict(), and decorate withregister_classifier().Example:
@register_classifier("my_clf") class MyClassifier(BaseClassifier): CATEGORY = "classical" FEATURE_KIND = "filter_features" def fit(self, train_features, train_labels, **kwargs): ... return self def predict(self, features): ... return labels
- abstractmethod fit(train_features, train_labels, val_features=None, val_labels=None, **kwargs)[source]
Train or fit the classifier on the prepared feature matrix.
- Parameters:
train_features (
ndarray) – Array shaped(n_train, feature_dim)(or method-specific).train_labels (
ndarray) – Integer labels aligned with train_features.val_features (
ndarray|None) – Optional validation features for early stopping / model selection.**kwargs (
Any) – Method-specific options (epochs, device, …).
- Return type:
- Returns:
self, for method chaining.
- classmethod from_config(config)[source]
Construct an instance from a YAML / dict section for this classifier.
- Parameters:
config (
dict[str,Any]) – Merged options from the global classifiers block and any per-name subsection (plus pipeline-injected keys such asfilter_setfor some methods).- Return type:
- Returns:
A ready-to-
fit()instance.- Raises:
NotImplementedError – If the subclass does not override this method.
- arcade.classifiers.ensure_classifiers_registered()[source]
Import built-in classifier packages so the registry is populated.
- Return type:
- arcade.classifiers.get_classifier(name)[source]
Resolve a classifier class by registry name or dotted import path.
- Parameters:
name (
str) – Either a registered key ("lda") or"package.module.ClassName"(last segment is the class).- Return type:
- Returns:
The classifier class (not an instance). Call
BaseClassifier.from_config()to construct.- Raises:
- arcade.classifiers.iq_trace_classifier_names()[source]
Return names of classifiers that consume IQ / raw traces (not MF scores).
- arcade.classifiers.list_classifiers()[source]
Return sorted registry names of all built-in classifiers.
Triggers
ensure_classifiers_registered()so the list is complete even before any classifier module was imported.
- arcade.classifiers.list_classifiers_with_descriptions()[source]
Return
(name, category, description)for every registered classifier.
- arcade.classifiers.register_classifier(name)[source]
Register a
BaseClassifiersubclass under name.The name is what appears in
classifiers.runin YAML.- Parameters:
name (
str) – Short registry key (e.g."fnn","my_clf").- Return type:
- Returns:
A class decorator that stores the class in the registry.
Example:
@register_classifier("my_clf") class MyClassifier(BaseClassifier): FEATURE_KIND = "filter_features" def fit(self, train_features, train_labels, **kwargs): return self def predict(self, features): ...