-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/mdm predict distances #248
Conversation
- override only the instance method and not the class function
…ull_cpm" add "weights_euclid_cpm"
@@ -472,7 +472,7 @@ def __init__( | |||
|
|||
def _create_pipe(self): | |||
clf_mean_logeuclid_dist_cpm = QuantumMDMWithRiemannianPipeline( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This VotingClassifier should be replaced by a voting classifier Q-MDM/NHC or Q-MDM/MDM
pyriemann_qiskit/utils/distance.py
Outdated
objectif = prob.sum( | ||
w[i] * distance(B, A[i]) for i in matrices | ||
) | ||
|
||
prob.set_objective("min", objectif) | ||
prob.add_constraint(prob.sum(w) == 1) | ||
weights = optimizer.solve(prob, reshape=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty basic. We can think of something clever in the future. Let's just put the structure in place.
Can you please put a more detailed description of the PR. |
pyriemann_qiskit/classification.py
Outdated
@@ -16,6 +17,7 @@ | |||
NaiveQAOAOptimizer, | |||
set_global_optimizer, | |||
) | |||
from pyriemann_qiskit.utils.distance import distance_functions, is_cpm_dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_cpm_dist
should be moved from utils.distance
to classification
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Yes, but I will need to move is_qmean
too, but it is also used in the pipeline
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should merge is_qdist
and is_qmean
into a generic is_qfunction
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Let's create a new module utils/utils.py
?
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
complete api.rst
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
…yQiskitOptimizer`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @gcattan !
Last remark: don't forget to update whatsnew file.
Thx @qbarthelemy :) Until now I was updating the whatsnew on each release only, based on the generated release notes. |
No, don't change anything. |
This PR:
_predict_distances
from thedistance
to theclassification
module._predict_distances
of the MDM class but only the one of a particular instance.dist_logeuclid_cpm
todist_logeuclid_to_convex_hull_cpm
euclid_cpm
andlogeuclid_cpm
(the idea would be rather to re-implement the recursion in the pyRiemann distance module in the CPM way)