Skip to content
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

Complete example with Firebase cache #119

Merged
merged 7 commits into from
Apr 14, 2023
Merged

Complete example with Firebase cache #119

merged 7 commits into from
Apr 14, 2023

Conversation

gcattan
Copy link
Collaborator

@gcattan gcattan commented Apr 6, 2023

Issue #84
This PR completed the example with MOABB and ERP classification.
It demonstrates how we can use Firebase admin to synchronize MOABB results.
A simple use case is to split the number of subjects in a dataset between two computers.
Then the two MOABB evaluations are run in parallel and the results are synchronized on the Firebase server.
It is also useful when we want to store and retrieve the results of past computation on a same computer.

@toncho11 FYI

@gcattan gcattan marked this pull request as ready for review April 6, 2023 20:00
@gcattan gcattan requested a review from toncho11 April 12, 2023 10:51
@toncho11
Copy link
Collaborator

Does Firebase require any login credentials?
Can it work locally?
Does the connector require Internet and Google access?

@gcattan
Copy link
Collaborator Author

gcattan commented Apr 12, 2023

  1. Yes, it requires credentials. The wiki page here https://github.com/pyRiemann/pyRiemann-qiskit/wiki/Use-a-Firebase-cache explains how to get credentials from Firebase.
  2. It can work locally. The generate_caches function accepts a dictionary object that, if provded, is used instead of the remote database. E.g.:
fake = {
   "Brain Invaders 2012":{
      "RG+QuantumSVM":{
         "Brain Invaders 2012":{
            "1":{
               "RG+QuantumSVM":{
                  "true_labels":0.3433986306190491,
                  "predicted_labels":0.5
               }
            },
         }
      },
      "RG+LDA":{
         "Brain Invaders 2012":{
            "1":{
               "RG+LDA":{
                  "true_labels":0.13163451850414276,
                  "predicted_labels":0.6777283549308777
               }
            },
            "2":{
               "RG+LDA":{
                  "true_labels":0.13357791304588318,
                  "predicted_labels":0.8143579959869385
               }
            }
         }
      }
   }
}
  1. Yes, if you want to connect to Firebase, you need internet and google credential. There is no replication of the database on local storage.

@toncho11
Copy link
Collaborator

I think there should be a separate example. We should not modify classify_P300_bi.py.

@toncho11
Copy link
Collaborator

toncho11 commented Apr 13, 2023

What is the dictionary object accepted by generate_caches? An empty one that is going to be filled by generate_caches?

@gcattan
Copy link
Collaborator Author

gcattan commented Apr 14, 2023

What is the dictionary object accepted by generate_caches? An empty one that is going to be filled by generate_caches?

It accepts a list of datasets, a list of pipelines and optionally a set of mock data.

@gcattan gcattan merged commit ed99245 into main Apr 14, 2023
@gcattan
Copy link
Collaborator Author

gcattan commented Apr 14, 2023

Thanks for the review :)

@gcattan gcattan deleted the use-caches-in-example branch June 2, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants