计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
algorithms【效率与协作】Train, evaluate, persist, and troubleshoot Qiskit Machine Learning classifiers, regressors, and quantum Bayesian inference with public scikit-learn-like APIs.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this route for end-to-end model work: choose a classifier or regressor,
prepare compatible X/y, attach a primitive and optimizer, call fit,
predict, and score, observe callbacks, continue with warm starts, persist a
model, or run QBayesian inference. Read the focused references progressively:
scripts/vqc_smoke.py for a tiny deterministic
VQC/ad-hoc-data check that is safe to invoke from any current directory.VQC, VQR, NeuralNetworkClassifier,
NeuralNetworkRegressor, QSVC, QSVR, PegasosQSVC, QBayesian,
TrainableModel, objective/loss selection, fit/predict/score,
callbacks, warm starts, and dill persistence.qnn-gradients.kernels-fidelity. This route
only explains the model-facing QSVC/QSVR contract.optimizers; choose only the model attachment here.data-circuits-connectors.python -m pip install qiskit-machine-learning; add only required public
optional extras. Do not assume a source checkout or a private import path.X a numeric two-dimensional array (n_samples, n_features) and
make its feature dimension match the feature-map data parameters/qubits.
Keep a separate held-out set for a meaningful score.api-reference.md.algorithm_globals.random_seed when deterministic initialization or
sampling matters. A successful fit returns self; inspect weights or
fit_result only after fitting.pass_manager for circuits that
require ISA transpilation. Preserve measurements for sampler circuits and
keep observables layout-aligned for estimator circuits; see the migration
sharp bits in troubleshooting.md.score and inspect prediction shape/content, not only an
optimizer objective. Classification score is mean accuracy; regression
score is the coefficient of determination (R^2).| Need | First choice | Critical contract |
|---|---|---|
| Variational classification | VQC | one-hot class probabilities; default cross_entropy |
| Variational scalar regression | VQR | estimator expectation target; default squared_error |
| Kernel classification | QSVC | pass quantum_kernel=..., never kernel=... |
| Kernel regression | QSVR | raw features or correctly shaped precomputed matrices |
| Large-step binary kernel classification | PegasosQSVC | binary labels; num_steps has no early stopping |
| Conditional probabilities | QBayesian | one-qubit named registers and binary evidence |
For a concrete recipe and recovery actions, read the references rather than copying private implementation details. Do not claim a statevector smoke proves a vendor backend, shot noise, cloud session, or optional dependency.