-
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
Example with financial data #195
Conversation
* add dependence to imbalanced_learn add example with financial data * print score remove dead code * add patent application number * [pre-commit.ci] auto fixes from pre-commit.com hooks * Update financial_data.py * Update financial_data.py Co-authored-by: fbarroso24 <fbarroso24@gmail.com> --------- Co-authored-by: Gregoire Cattan <gregoire.cattan@ibm.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: fbarroso24 <fbarroso24@gmail.com>
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.
It's really great to have a real example on another type of data than biosignals!
) | ||
|
||
############################################################################## | ||
# Run evaluation |
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.
What are the non-quantum state-of-the-art methods for detecting financial fraud?
It would be good to add them in the comparison.
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.
Good idea! May be some decision tree/random forst. @fbarroso24 what do you think?
pipe, | ||
param_grid={ | ||
"toepochs__n": [10, 20], | ||
"xdawncovariances__nfilter": [1, 2], |
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.
You should test higher values for nfilter.
What is the number of features?
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.
Only three in this example. We could add more features, but the simulation time is quite long.
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.
With more features, classical pipeline would perform much better.
It seems unfair that time issues linked to quantum pipeline hamper the performance of classical one.
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.
Makes sense. I can try, and find a compromise for the pipeline afterwhat.
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
- improve description - add train/test split
- missing propagation of X_train/X_test changes
- display best csv_results without pandas
score_qsvm = gs.best_estimator_.fit(X_train, y_train).score(X_test, y_test) | ||
|
||
# Print the results | ||
print(f"Classical: {score_svm} \nQuantum : {score_qsvm}") |
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.
Quantum pipeline gives a binary classification score of 0,5.
Flipping a coin would do the same thing... unless I missed something.
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.
No, this is weird.
In the first version, it was 100%... but with the same data.
I need to investigate this.
- switch to halvinggridsearchcv
@qbarthelemy I made another pass on the example. There are mainly two changes:
I also gave a tried to the halving grid search. It is quicker, but may be less accurate than the standard grid search. |
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>
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>
Co-authored-by: Quentin Barthélemy <q.barthelemy@gmail.com>
This is an example based on a patent application exploiting RG+quantum for detecting fraudulent behavior.