You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no point in saving and loading model if the fitted quantum kernel is not saved and loaded since it is the main bottleneck of the calculation for simulations.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered:
It returns an error because you initialise qsvr2 manually instead of letting the @classmethod do it for you. So not all the attributes from dill could overwrite the default ones created ex novo. The fitted check in scipy checks for vars with a starting undescore, which aren't present at initialisation and somehow don't get created on an existing instance.
The example above runs without the NotFittedError if you use the classmethod directly:
qsvc=QSVC(quantum_kernel=adhoc_kernel)
qsvc.fit(train_features, train_labels)
qsvc.save('model')
qsvc2=QSVC.load('model') # <-- this explicitly uses the @classmethodprint(qsvc2.score(train_features, train_labels))
We could change the naming and add an example to the docs to make this clearer (see upcoming PR).
Uh oh!
There was an error while loading. Please reload this page.
Environment
What is happening?
I think QSVC does not save the fitted QSVC correctly. Using QSVC.save() and QSVC.load() throws a SVC not fitted error.
sklearn.exceptions.NotFittedError: This QSVC instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.
Also, there is no way to call fitted kernel, and I think it is not saved neither.
How can we reproduce the issue?
What should happen?
There is no point in saving and loading model if the fitted quantum kernel is not saved and loaded since it is the main bottleneck of the calculation for simulations.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: