diff --git a/my_first_analysis/multi-session_classifiers.ipynb b/my_first_analysis/multi-session_classifiers.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..a15050789970c4733dbf8b2fcb5ae20352d6ecb5 --- /dev/null +++ b/my_first_analysis/multi-session_classifiers.ipynb @@ -0,0 +1,608 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "f1794525-10f8-4af4-8129-089a692bcc3e", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "#you must import 6 libraries!\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt, seaborn as sns\n", + "import Inflow\n", + "Inflow.logging.enable_logging()\n", + "import ResearchProjects\n", + "import pandas as pd\n", + "import one" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "d9d440e7-44d4-4d3e-9444-486993b1312c", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "#adaptation is a sublibrary within the ResearchProject\n", + "from ResearchProjects import adaptation\n", + "#inside adaptation experiment there are different file, we import the \"aliases\"\n", + "from ResearchProjects.adaptation import aliases" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "36c1c316-546a-428f-80de-d79d999ff644", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "<function ResearchProjects.adaptation.select.cells_labelled(rois_df, iscell=True, **kwargs)>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/plain": [ + "\u001b[1;31mType:\u001b[0m module\n", + "\u001b[1;31mString form:\u001b[0m <module 'ResearchProjects.core' from 'c:\\\\users\\\\tjostmou\\\\documents\\\\python\\\\__packages__\\\\researchprojects\\\\ResearchProjects\\\\core.py'>\n", + "\u001b[1;31mFile:\u001b[0m c:\\users\\tjostmou\\documents\\python\\__packages__\\researchprojects\\researchprojects\\core.py\n", + "\u001b[1;31mDocstring:\u001b[0m <no docstring>\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "connector = one.ONE()\n", + "connector.set_data_access_mode('local')\n", + "ResearchProjects.core?\n", + "ResearchProjects.adaptation.select.cells_labelled\n", + "display(ResearchProjects.adaptation.select.cells_labelled)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "3b5e240a-dab1-48f1-b238-9c509f08606f", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>subject</th>\n", + " <th>start_time</th>\n", + " <th>number</th>\n", + " <th>lab</th>\n", + " <th>projects</th>\n", + " <th>url</th>\n", + " <th>task_protocol</th>\n", + " <th>date</th>\n", + " <th>json</th>\n", + " <th>extended_qc</th>\n", + " <th>rel_path</th>\n", + " <th>alias_name</th>\n", + " <th>short_path</th>\n", + " <th>path</th>\n", + " </tr>\n", + " <tr>\n", + " <th>id</th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>6ae1a8dc-10b8-4858-b860-d183c5aa0f1a</th>\n", + " <td>wm25</td>\n", + " <td>2022-08-05T15:48:00</td>\n", + " <td>1</td>\n", + " <td>HaissLab</td>\n", + " <td>[Adaptation]</td>\n", + " <td>http://157.99.138.172/sessions/6ae1a8dc-10b8-4...</td>\n", + " <td></td>\n", + " <td>2022-08-05</td>\n", + " <td>{'channels': ['R', 'G'], 'whisker_stims': {'St...</td>\n", + " <td>None</td>\n", + " <td>wm25\\2022-08-05\\001</td>\n", + " <td>wm25_2022_08_05_001</td>\n", + " <td>wm25\\2022-08-05\\001</td>\n", + " <td>D:\\LOCAL_DATA\\wm25\\2022-08-05\\001</td>\n", + " </tr>\n", + " <tr>\n", + " <th>6c278f55-5460-4fba-baad-fcbb3e2cd2f0</th>\n", + " <td>wm25</td>\n", + " <td>2022-08-04T12:35:00</td>\n", + " <td>1</td>\n", + " <td>HaissLab</td>\n", + " <td>[Adaptation]</td>\n", + " <td>http://157.99.138.172/sessions/6c278f55-5460-4...</td>\n", + " <td></td>\n", + " <td>2022-08-04</td>\n", + " <td>{'channels': ['R', 'G'], 'whisker_stims': {'St...</td>\n", + " <td>{'exclude_whisker': ['C1']}</td>\n", + " <td>wm25\\2022-08-04\\001</td>\n", + " <td>wm25_2022_08_04_001</td>\n", + " <td>wm25\\2022-08-04\\001</td>\n", + " <td>D:\\LOCAL_DATA\\wm25\\2022-08-04\\001</td>\n", + " </tr>\n", + " <tr>\n", + " <th>8207a627-7d7d-4d05-a34f-790339314e2a</th>\n", + " <td>wm25</td>\n", + " <td>2022-08-03T13:07:00</td>\n", + " <td>1</td>\n", + " <td>HaissLab</td>\n", + " <td>[Adaptation]</td>\n", + " <td>http://157.99.138.172/sessions/8207a627-7d7d-4...</td>\n", + " <td></td>\n", + " <td>2022-08-03</td>\n", + " <td>{'channels': ['R', 'G'], 'whisker_stims': {'St...</td>\n", + " <td>None</td>\n", + " <td>wm25\\2022-08-03\\001</td>\n", + " <td>wm25_2022_08_03_001</td>\n", + " <td>wm25\\2022-08-03\\001</td>\n", + " <td>D:\\LOCAL_DATA\\wm25\\2022-08-03\\001</td>\n", + " </tr>\n", + " <tr>\n", + " <th>247172f8-f971-4eea-a0e9-251091b16b56</th>\n", + " <td>wm25</td>\n", + " <td>2022-08-02T12:31:00</td>\n", + " <td>1</td>\n", + " <td>HaissLab</td>\n", + " <td>[Adaptation]</td>\n", + " <td>http://157.99.138.172/sessions/247172f8-f971-4...</td>\n", + " <td></td>\n", + " <td>2022-08-02</td>\n", + " <td>{'channels': ['R', 'G'], 'whisker_stims': {'St...</td>\n", + " <td>None</td>\n", + " <td>wm25\\2022-08-02\\001</td>\n", + " <td>wm25_2022_08_02_001</td>\n", + " <td>wm25\\2022-08-02\\001</td>\n", + " <td>D:\\LOCAL_DATA\\wm25\\2022-08-02\\001</td>\n", + " </tr>\n", + " <tr>\n", + " <th>6357f070-ae88-4008-bd9a-2b22d243079d</th>\n", + " <td>wm25</td>\n", + " <td>2022-08-01T12:47:18</td>\n", + " <td>1</td>\n", + " <td>HaissLab</td>\n", + " <td>[Adaptation]</td>\n", + " <td>http://157.99.138.172/sessions/6357f070-ae88-4...</td>\n", + " <td></td>\n", + " <td>2022-08-01</td>\n", + " <td>{'channels': ['R', 'G'], 'whisker_stims': {'St...</td>\n", + " <td>None</td>\n", + " <td>wm25\\2022-08-01\\001</td>\n", + " <td>wm25_2022_08_01_001</td>\n", + " <td>wm25\\2022-08-01\\001</td>\n", + " <td>D:\\LOCAL_DATA\\wm25\\2022-08-01\\001</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " subject start_time number \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a wm25 2022-08-05T15:48:00 1 \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 wm25 2022-08-04T12:35:00 1 \n", + "8207a627-7d7d-4d05-a34f-790339314e2a wm25 2022-08-03T13:07:00 1 \n", + "247172f8-f971-4eea-a0e9-251091b16b56 wm25 2022-08-02T12:31:00 1 \n", + "6357f070-ae88-4008-bd9a-2b22d243079d wm25 2022-08-01T12:47:18 1 \n", + "\n", + " lab projects \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a HaissLab [Adaptation] \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 HaissLab [Adaptation] \n", + "8207a627-7d7d-4d05-a34f-790339314e2a HaissLab [Adaptation] \n", + "247172f8-f971-4eea-a0e9-251091b16b56 HaissLab [Adaptation] \n", + "6357f070-ae88-4008-bd9a-2b22d243079d HaissLab [Adaptation] \n", + "\n", + " url \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a http://157.99.138.172/sessions/6ae1a8dc-10b8-4... \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 http://157.99.138.172/sessions/6c278f55-5460-4... \n", + "8207a627-7d7d-4d05-a34f-790339314e2a http://157.99.138.172/sessions/8207a627-7d7d-4... \n", + "247172f8-f971-4eea-a0e9-251091b16b56 http://157.99.138.172/sessions/247172f8-f971-4... \n", + "6357f070-ae88-4008-bd9a-2b22d243079d http://157.99.138.172/sessions/6357f070-ae88-4... \n", + "\n", + " task_protocol date \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a 2022-08-05 \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 2022-08-04 \n", + "8207a627-7d7d-4d05-a34f-790339314e2a 2022-08-03 \n", + "247172f8-f971-4eea-a0e9-251091b16b56 2022-08-02 \n", + "6357f070-ae88-4008-bd9a-2b22d243079d 2022-08-01 \n", + "\n", + " json \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a {'channels': ['R', 'G'], 'whisker_stims': {'St... \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 {'channels': ['R', 'G'], 'whisker_stims': {'St... \n", + "8207a627-7d7d-4d05-a34f-790339314e2a {'channels': ['R', 'G'], 'whisker_stims': {'St... \n", + "247172f8-f971-4eea-a0e9-251091b16b56 {'channels': ['R', 'G'], 'whisker_stims': {'St... \n", + "6357f070-ae88-4008-bd9a-2b22d243079d {'channels': ['R', 'G'], 'whisker_stims': {'St... \n", + "\n", + " extended_qc \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a None \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 {'exclude_whisker': ['C1']} \n", + "8207a627-7d7d-4d05-a34f-790339314e2a None \n", + "247172f8-f971-4eea-a0e9-251091b16b56 None \n", + "6357f070-ae88-4008-bd9a-2b22d243079d None \n", + "\n", + " rel_path \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a wm25\\2022-08-05\\001 \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 wm25\\2022-08-04\\001 \n", + "8207a627-7d7d-4d05-a34f-790339314e2a wm25\\2022-08-03\\001 \n", + "247172f8-f971-4eea-a0e9-251091b16b56 wm25\\2022-08-02\\001 \n", + "6357f070-ae88-4008-bd9a-2b22d243079d wm25\\2022-08-01\\001 \n", + "\n", + " alias_name \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a wm25_2022_08_05_001 \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 wm25_2022_08_04_001 \n", + "8207a627-7d7d-4d05-a34f-790339314e2a wm25_2022_08_03_001 \n", + "247172f8-f971-4eea-a0e9-251091b16b56 wm25_2022_08_02_001 \n", + "6357f070-ae88-4008-bd9a-2b22d243079d wm25_2022_08_01_001 \n", + "\n", + " short_path \\\n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a wm25\\2022-08-05\\001 \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 wm25\\2022-08-04\\001 \n", + "8207a627-7d7d-4d05-a34f-790339314e2a wm25\\2022-08-03\\001 \n", + "247172f8-f971-4eea-a0e9-251091b16b56 wm25\\2022-08-02\\001 \n", + "6357f070-ae88-4008-bd9a-2b22d243079d wm25\\2022-08-01\\001 \n", + "\n", + " path \n", + "id \n", + "6ae1a8dc-10b8-4858-b860-d183c5aa0f1a D:\\LOCAL_DATA\\wm25\\2022-08-05\\001 \n", + "6c278f55-5460-4fba-baad-fcbb3e2cd2f0 D:\\LOCAL_DATA\\wm25\\2022-08-04\\001 \n", + "8207a627-7d7d-4d05-a34f-790339314e2a D:\\LOCAL_DATA\\wm25\\2022-08-03\\001 \n", + "247172f8-f971-4eea-a0e9-251091b16b56 D:\\LOCAL_DATA\\wm25\\2022-08-02\\001 \n", + "6357f070-ae88-4008-bd9a-2b22d243079d D:\\LOCAL_DATA\\wm25\\2022-08-01\\001 " + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sessions = connector.search(subject = \"wm25\",number = 1, details= True) ###Did not work(OSError: No result exists for trials_df in session wm24_2022_08_09_001)\n", + "#sessions = connector.search(subject = 'wm24', date_range = [\"2022-08-01\",\"2022-08-22\"], number = 1, details = True)\n", + "session = sessions.iloc[0]\n", + "sessions" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "03ac0a0c-cc40-4a55-b7a8-47c7aa83b61c", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "trials_roi_df = adaptation.pipelines.multisession.get_trials_roi_df(sessions)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "32b3d539-4913-4104-ba37-951458008a0e", + "metadata": {}, + "outputs": [], + "source": [ + "trials_roi_df = adaptation.fluorescence.normalize_all_trials_per_roi(trials_roi_df)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "b1481386-fd5d-463e-9b2a-5162931cbd79", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "trials_roi_df = adaptation.classifiers.extract_features_from_timeseries( trials_roi_df , extract_key = \"F_var_norm\" , features_key = \"neuronal_features\")" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "98c298ff-31b7-4c98-b7f4-94959fbf654a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ROI {'session#': 'wm25_2022_08_05_001', 'roi#': 135} of 150\r" + ] + } + ], + "source": [ + "rois_classifiers = []\n", + "condition_keys = [\"nontarget_amplitude\"]\n", + "\n", + "groups = adaptation.select.get_groups_by_index(trials_roi_df,\"trial#\")\n", + "\n", + "for indices, roi_group in groups: \n", + " #if not roi_group.iloc[0][\"in_any_barrel\"] :\n", + " # continue\n", + " #print(indices)\n", + " indices = {key : value for key, value in zip(groups.keys,indices)}\n", + " print(f\"ROI {indices} of {len(roi_group)}\",end = \"\\r\")\n", + " \n", + " for condition_values , group_df in roi_group.groupby( condition_keys ) : \n", + " conditions = {key : value for key, value in zip(condition_keys , condition_values)}\n", + " if conditions[\"nontarget_amplitude\"] == '10' :\n", + " continue\n", + " \n", + " results = adaptation.classifiers.get_loocv_results(group_df,features_key = \"neuronal_features\", classes_key = \"target_amplitude\", n_estimators = 100, n_jobs = 30)\n", + " conditions.update(results)\n", + " conditions.update(indices)\n", + " rois_classifiers.append(conditions)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "87d0c39b-e0fc-424a-a4fb-1392f5ec22ab", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th>corrected_accuracy</th>\n", + " <th>chance_values</th>\n", + " <th>accuracy</th>\n", + " <th>chance</th>\n", + " </tr>\n", + " <tr>\n", + " <th>session#</th>\n", + " <th>roi#</th>\n", + " <th>nontarget_amplitude</th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " <th></th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th rowspan=\"5\" valign=\"top\">wm25_2022_08_01_001</th>\n", + " <th rowspan=\"2\" valign=\"top\">0</th>\n", + " <th>0</th>\n", + " <td>-0.175000</td>\n", + " <td>[0.5394736842105263, 0.4473684210526316, 0.552...</td>\n", + " <td>0.381579</td>\n", + " <td>0.473684</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>0.225000</td>\n", + " <td>[0.527027027027027, 0.5405405405405406, 0.5, 0...</td>\n", + " <td>0.581081</td>\n", + " <td>0.459459</td>\n", + " </tr>\n", + " <tr>\n", + " <th rowspan=\"2\" valign=\"top\">1</th>\n", + " <th>0</th>\n", + " <td>-0.097561</td>\n", + " <td>[0.4605263157894737, 0.42105263157894735, 0.52...</td>\n", + " <td>0.407895</td>\n", + " <td>0.460526</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>0.170732</td>\n", + " <td>[0.43243243243243246, 0.4594594594594595, 0.39...</td>\n", + " <td>0.540541</td>\n", + " <td>0.445946</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <th>0</th>\n", + " <td>0.205128</td>\n", + " <td>[0.39473684210526316, 0.5921052631578947, 0.47...</td>\n", + " <td>0.592105</td>\n", + " <td>0.486842</td>\n", + " </tr>\n", + " <tr>\n", + " <th>...</th>\n", + " <th>...</th>\n", + " <th>...</th>\n", + " <td>...</td>\n", + " <td>...</td>\n", + " <td>...</td>\n", + " <td>...</td>\n", + " </tr>\n", + " <tr>\n", + " <th rowspan=\"5\" valign=\"top\">wm25_2022_08_05_001</th>\n", + " <th>133</th>\n", + " <th>1</th>\n", + " <td>0.530864</td>\n", + " <td>[0.49333333333333335, 0.41333333333333333, 0.4...</td>\n", + " <td>0.746667</td>\n", + " <td>0.460000</td>\n", + " </tr>\n", + " <tr>\n", + " <th rowspan=\"2\" valign=\"top\">134</th>\n", + " <th>0</th>\n", + " <td>-0.185185</td>\n", + " <td>[0.52, 0.52, 0.4533333333333333, 0.50666666666...</td>\n", + " <td>0.360000</td>\n", + " <td>0.460000</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>0.000000</td>\n", + " <td>[0.3466666666666667, 0.48, 0.5333333333333333,...</td>\n", + " <td>0.453333</td>\n", + " <td>0.453333</td>\n", + " </tr>\n", + " <tr>\n", + " <th rowspan=\"2\" valign=\"top\">135</th>\n", + " <th>0</th>\n", + " <td>0.341463</td>\n", + " <td>[0.4, 0.4, 0.36, 0.52, 0.6133333333333333, 0.4...</td>\n", + " <td>0.640000</td>\n", + " <td>0.453333</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>0.512195</td>\n", + " <td>[0.41333333333333333, 0.49333333333333335, 0.5...</td>\n", + " <td>0.733333</td>\n", + " <td>0.453333</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "<p>1156 rows × 4 columns</p>\n", + "</div>" + ], + "text/plain": [ + " corrected_accuracy \\\n", + "session# roi# nontarget_amplitude \n", + "wm25_2022_08_01_001 0 0 -0.175000 \n", + " 1 0.225000 \n", + " 1 0 -0.097561 \n", + " 1 0.170732 \n", + " 2 0 0.205128 \n", + "... ... \n", + "wm25_2022_08_05_001 133 1 0.530864 \n", + " 134 0 -0.185185 \n", + " 1 0.000000 \n", + " 135 0 0.341463 \n", + " 1 0.512195 \n", + "\n", + " chance_values \\\n", + "session# roi# nontarget_amplitude \n", + "wm25_2022_08_01_001 0 0 [0.5394736842105263, 0.4473684210526316, 0.552... \n", + " 1 [0.527027027027027, 0.5405405405405406, 0.5, 0... \n", + " 1 0 [0.4605263157894737, 0.42105263157894735, 0.52... \n", + " 1 [0.43243243243243246, 0.4594594594594595, 0.39... \n", + " 2 0 [0.39473684210526316, 0.5921052631578947, 0.47... \n", + "... ... \n", + "wm25_2022_08_05_001 133 1 [0.49333333333333335, 0.41333333333333333, 0.4... \n", + " 134 0 [0.52, 0.52, 0.4533333333333333, 0.50666666666... \n", + " 1 [0.3466666666666667, 0.48, 0.5333333333333333,... \n", + " 135 0 [0.4, 0.4, 0.36, 0.52, 0.6133333333333333, 0.4... \n", + " 1 [0.41333333333333333, 0.49333333333333335, 0.5... \n", + "\n", + " accuracy chance \n", + "session# roi# nontarget_amplitude \n", + "wm25_2022_08_01_001 0 0 0.381579 0.473684 \n", + " 1 0.581081 0.459459 \n", + " 1 0 0.407895 0.460526 \n", + " 1 0.540541 0.445946 \n", + " 2 0 0.592105 0.486842 \n", + "... ... ... \n", + "wm25_2022_08_05_001 133 1 0.746667 0.460000 \n", + " 134 0 0.360000 0.460000 \n", + " 1 0.453333 0.453333 \n", + " 135 0 0.640000 0.453333 \n", + " 1 0.733333 0.453333 \n", + "\n", + "[1156 rows x 4 columns]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rois_classifiers = pd.DataFrame(rois_classifiers).reset_index().set_index(groups.keys+condition_keys)\n", + "rois_classifiers" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}