Evaluators
An evaluator (the Oracle) scores every circuit in the pool on a dataset via cross-validated quantum-kernel methods. It is used offline only - to build the meta-dataset labels and to validate recommendations. Inference never touches it.
A new Oracle implements the three-member contract of BaseEvaluator
(task_type, metric_name, evaluate_circuit); the base class provides
evaluate_all and build_pivot on top.
Qmes.get_evaluator
Return the Oracle evaluator for the given task type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_type
|
(classification, regression)
|
|
'classification'
|
**kwargs
|
passed to evaluator constructor (e.g. n_splits, max_features)
|
|
{}
|
Returns:
| Type | Description |
|---|---|
Concrete BaseEvaluator instance
|
|
Qmes.evaluators.BaseEvaluator
Bases: ABC
Evaluate all circuits on a dataset, return performance scores.
evaluate_circuit
abstractmethod
Evaluate one circuit on one dataset.
Returns:
| Type | Description |
|---|---|
dict with keys like 'mean_mcc', 'std_mcc', etc.
|
|
evaluate_all
Evaluate all circuits on one dataset.
Returns:
| Type | Description |
|---|---|
{circuit_name: {metric: value, ...}, ...}
|
|
Qmes.ClassificationEvaluator
Bases: BaseEvaluator
Evaluate encoding circuits for binary classification via quantum-kernel SVC.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_splits
|
int
|
Number of StratifiedKFold CV folds used to estimate circuit performance. |
3
|
max_features
|
int
|
Maximum number of PCA components (qubits) fed into the quantum kernel. Capped at 4 to match the qubit budget of the Qsun simulator; datasets with more raw features are projected down via PCA fit on the train split only. |
4
|
random_state
|
int
|
Seed for StratifiedKFold and PCA. |
42
|
Qmes.RegressionEvaluator
Bases: BaseEvaluator
Evaluate encoding circuits for tabular regression via quantum-kernel KRR.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_splits
|
int
|
Number of KFold CV folds used to estimate circuit performance. |
3
|
max_features
|
int
|
Maximum number of PCA components (qubits) fed into the quantum kernel. Capped at 4 to match the qubit budget of the Qsun simulator; datasets with more raw features are projected down via PCA fit on the train split only. |
4
|
random_state
|
int
|
Seed for StratifiedKFold and PCA. |
42
|
Qmes.filter_degenerate_datasets
Remove no-signal and ceiling datasets from a pivot table.
Task-agnostic: operates on any (circuit x dataset) score pivot regardless of whether scores are MCC, R2, or another metric, so it lives here rather than in a concrete task's evaluator module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pivot
|
DataFrame, index=circuits, columns=datasets
|
|
required |
min_max_score
|
drop if max score across circuits < this
|
|
0.1
|
ceiling_threshold
|
drop if min score across circuits >= this
|
|
0.99
|
Returns:
| Type | Description |
|---|---|
(clean_pivot, removed_dict)
|
|