Skip to content

Commit

Permalink
adapt example
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmerk committed Nov 14, 2023
1 parent 4775dc1 commit 95ae0ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions examples/plot_1_example_BIDS.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@
# The resulting raw object is of type `mne.RawArray <https://mne.tools/stable/generated/mne.io.RawArray.html>`_.
# We can use the properties such as sampling frequency, channel names, channel types all from the mne array and create the *nm_channels* DataFrame:

RUN_NAME, PATH_RUN, PATH_BIDS, PATH_OUT, datatype = nm_IO.get_paths_example_data()
(
RUN_NAME,
PATH_RUN,
PATH_BIDS,
PATH_OUT,
datatype,
) = nm_IO.get_paths_example_data()

(
raw,
Expand Down Expand Up @@ -85,9 +91,9 @@
settings = nm_settings.set_settings_fast_compute(settings)

settings["features"]["fft"] = True
settings["features"]["bursts"] = False
settings["features"]["sharpwave_analysis"] = False
settings["features"]["coherence"] = False # True
settings["features"]["bursts"] = True
settings["features"]["sharpwave_analysis"] = True
settings["features"]["coherence"] = True # True
settings["coherence"]["channels"] = [["LFP_RIGHT_0", "ECOG_RIGHT_0"]]
settings["coherence"]["frequency_bands"] = ["high beta", "low gamma"]
settings["sharpwave_analysis_settings"]["estimator"]["mean"] = []
Expand Down Expand Up @@ -154,7 +160,7 @@

# %%
feature_reader.plot_all_features(
ytick_labelsize=3,
ytick_labelsize=6,
clim_low=-2,
clim_high=2,
ch_used="ECOG_RIGHT_0",
Expand Down Expand Up @@ -186,7 +192,7 @@
#
# Here, we show an example using the XGBOOST classifier. The used labels came from a continuous grip force movement target, named "MOV_RIGHT".
#
# First we initialize the :class:`~nm_decode.Decoder` class, which the specified *validation method*, here being a simple 3-fold cross validation,
# First we initialize the :class:`~nm_decode.Decoder` class, which the specified *validation method*, here being a simple 3-fold cross validation,
# the evaluation metric, used machine learning model, and the channels we want to evaluate performances for.
#
# There are many more implemented methods, but we will here limit it to the ones presented.
Expand Down Expand Up @@ -225,7 +231,7 @@
y_col="performance_test",
hue="ch_type",
PATH_SAVE=PATH_OUT / RUN_NAME / (RUN_NAME + "_decoding_performance.png"),
figsize_tuple=(8, 5)
figsize_tuple=(8, 5),
)
ax.set_ylabel(r"$R^2$ Correlation")
ax.set_xlabel("Subject 000")
Expand Down
2 changes: 1 addition & 1 deletion py_neuromodulation/nm_define_nmchannels.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def set_channels(
ecog_only: bool = False,
used_types: Optional[Iterable[str]] = ("ecog", "dbs", "seeg"),
target_keywords: Optional[Iterable[str]] = ("mov", "squared", "label"),
):
) -> pd.DataFrame:
"""Return dataframe with channel-specific settings in nm_channels format.
Return an nm_channels dataframe with the columns: "name", "rereference",
Expand Down

0 comments on commit 95ae0ed

Please sign in to comment.