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

Fix results in doc for left/right MI #599

Merged
merged 17 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,10 @@ analysis/*

# mac os x stuff
*DS_store*

# local files generated by doc
docs/source/auto_*/
docs/source/generated/
examples/advanced_examples/Results/
examples/benchmark/
examples/results/
5 changes: 5 additions & 0 deletions contexts/mi_rh_f.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MotorImagery:
n_classes: 2
events:
- right_hand
- feet
19 changes: 8 additions & 11 deletions docs/source/paper_results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.3/css/dataTables.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/2.0.3/js/dataTables.js"></script>
<div style="font-size: 1.5em;">
<div style="font-size: 1em;">

.. currentmodule:: moabb.datasets

Expand Down Expand Up @@ -68,27 +68,24 @@ Motor Imagery - Left vs Right Hand
</tr>
</thead>
</table>
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function() {
$('#mileftvsright').DataTable( {
"ajax": 'https://raw.githubusercontent.com/bruAristimunha/moabb/table_results/results/within_session_mi_left_vs_right_hand.json',
"ajax": 'https://raw.githubusercontent.com/NeuroTechX/moabb/develop/results/within_session_mi_left_vs_right_hand.json',
"order": [[ 1, "desc" ]],
"bJQueryUI": true,
"scrollX": true,
"paging": false,
"info": false,
"searching": false,
layout: {
topStart: {
buttons: ['copyHtml5']
}
} );
} );
</script>
<hr>




Motor Imagery - Right Hand vs Feet
==================================

Expand Down Expand Up @@ -119,7 +116,7 @@ Motor Imagery - Right Hand vs Feet
<script type="text/javascript">
$(document).ready(function() {
$('#mirightvsfeet').DataTable( {
"ajax": 'https://raw.githubusercontent.com/bruAristimunha/moabb/table_results/results/within_session_mi_right_hand_vs_feet.json',
"ajax": 'https://raw.githubusercontent.com/NeuroTechX/moabb/develop/results/within_session_mi_right_hand_vs_feet.json',
"order": [[ 1, "desc" ]],
"bJQueryUI": true,
"scrollX": true,
Expand Down Expand Up @@ -162,7 +159,7 @@ Motor Imagery - All classes
<script type="text/javascript">
$(document).ready(function() {
$('#mi-all').DataTable( {
"ajax": 'https://raw.githubusercontent.com/bruAristimunha/moabb/table_results/results/within_session_mi_all_classes.json',
"ajax": 'https://raw.githubusercontent.com/NeuroTechX/moabb/develop/results/within_session_mi_all_classes.json',
"order": [[ 1, "desc" ]],
"bJQueryUI": true,
"scrollX": true,
Expand Down Expand Up @@ -205,7 +202,7 @@ We use all the classes available in the dataset.
<script type="text/javascript">
$(document).ready(function() {
$('#ssvep').DataTable( {
"ajax": 'https://raw.githubusercontent.com/bruAristimunha/moabb/table_results/results/within_session_ssvep_all_classes.json',
"ajax": 'https://raw.githubusercontent.com/NeuroTechX/moabb/develop/results/within_session_ssvep_all_classes.json',
"order": [[ 1, "desc" ]],
"bJQueryUI": true,
"scrollX": true,
Expand Down Expand Up @@ -253,7 +250,7 @@ We use all the classes available in the dataset.
<script type="text/javascript">
$(document).ready(function() {
$('#p300').DataTable( {
"ajax": 'https://raw.githubusercontent.com/bruAristimunha/moabb/table_results/results/within_session_erp_p300_all_classes.json',
"ajax": 'https://raw.githubusercontent.com/NeuroTechX/moabb/develop/results/within_session_erp_p300_all_classes.json',
"order": [[ 1, "desc" ]],
"bJQueryUI": true,
"scrollX": true,
Expand Down
1 change: 1 addition & 0 deletions docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Bugs
- Fix mne_bids version incompatibility with mne (:gh:`586` by `Bruna Lopes`_)
- Updating the parameters of the SSVEP_TRCA method (:gh:`589` by `Bruno Aristimunha`_)
- Fix and updating the parameters for the benchmark function (:gh:`588` by `Bruno Aristimunha`_)
- Fix result table display (:gh:`599` by `Sylvain Chevallier`_)
- Fix :class:`moabb.datasets.preprocessing.SetRawAnnotations` setting incorrect annotations when the dataset's interval does not start at 0 (:gh:`607` by `Pierre Guetschel`_)
- Fix download link for GigaDB Cho2017 and Lee2019 datasets (:gh:`621` by `Anton Andreev`_)

Expand Down
38 changes: 38 additions & 0 deletions results/csv_json_results_converter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import argparse
import csv
import json
import pathlib


def csv_to_json(source_file, output_file):
jsonArray = []

with open(source_file, encoding="utf-8") as csvf:
# load csv file data using csv reader
csvReader = csv.reader(csvf)
for row in csvReader:
jsonArray.append(row)

# remove ` and trailing _
for e in jsonArray[1:]:
e[0] = e[0].split("`")[1]

# remove column names
jsonArray = {"data": jsonArray[1:]}

with open(output_file, "w", encoding="utf-8") as jsonf:
jsonString = json.dumps(jsonArray, indent=4)
jsonf.write(jsonString)
jsonf.write("")


if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="csv_json_results_converter.py",
description="Convert CSV results file in JSON for doc generation",
)
parser.add_argument("source_file", type=pathlib.Path, help="CSV result file")
args = parser.parse_args()
output_file = args.source_file.with_suffix(".json")

csv_to_json(args.source_file, output_file)
2 changes: 1 addition & 1 deletion results/within_session_mi_left_vs_right_hand.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pipeline,:class:`BNCI2014_001`,:class:`BNCI2014_004`,:class:`Cho2017`,:class:`Gr
`EEGTCNet`_,67.46±20.81,69.70±19.55,58.34±12.63,68.45±16.27,55.68±12.75,55.90±12.74,75.62±22.33,51.26±16.77,63.16±18.32,82.24±9.40
`FilterBank+SVM`_,84.44±16.00,80.39±16.05,67.91±15.63,79.65±18.63,75.07±16.97,58.45±13.93,81.44±17.89,65.63±21.64,76.81±18.88,92.64±5.01
`FgMDM`_,86.53±12.14,79.28±15.25,72.90±12.70,87.02±13.20,81.34±13.93,68.46±19.06,86.71±13.79,70.86±23.36,78.41±14.85,92.54±6.67
`LogVariance+LDA`_,77.96±15.09,78.51±15.25,64.49±10.08,78.71±11.69,66.21±12.06,61.94±14.41,78.44±13.76,61.78±22.77,74.13±10.40,88.39±8.57,
`LogVariance+LDA`_,77.96±15.09,78.51±15.25,64.49±10.08,78.71±11.69,66.21±12.06,61.94±14.41,78.44±13.76,61.78±22.77,74.13±10.40,88.39±8.57
`LogVariance+SVM`_,75.86±16.45,78.30±15.18,65.46±11.71,81.73±12.40,73.83±13.85,62.35±16.87,79.42±13.66,61.38±22.68,74.85±11.33,88.47±8.50
`MDM`_,81.69±14.94,77.66±15.78,63.39±13.69,64.29±8.04,70.23±13.87,54.76±16.79,61.53±16.41,62.99±21.25,58.80±16.13,90.70±7.11
`ShallowConvNet`_,86.17±13.74,72.36±18.05,73.84±14.95,86.53±13.00,75.83±15.04,65.19±15.80,84.82±15.29,60.80±19.27,79.10±12.63,95.65±5.55
Expand Down