sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
7dfb86643ece077b4cc0800122fe52580e60d1c17182da68bff0aacafba9778f | Jupyter | 22,682 | 699 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigureS2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %%
# @title Importe libraries and functions
import numpy as np
import pandas as pd
i... |
a608b6cddd2317d4e5da4fc9823354abf05c4dbcf4863569f024cba7a7ab3a8d | Jupyter | 22,735 | 642 | # %% [markdown]
# # Model Implementation Habituation Session 1
# %% [markdown]
# # Imports
# %%
import numpy as np
import random
import pandas as pd
import matplotlib.pyplot as plt
from scipy.integrate import odeint, solve_ivp
import seaborn as sns
from sklearn.metrics import mean_squared_error, r2_score
from lmfit i... |
956810044bf0815429c46acd53d6f2aabcf189e8b934ad8d44348125ec5efcbb | Jupyter | 22,736 | 642 | # %% [markdown]
# # Model Implementation Habituation Session 6
# %% [markdown]
# # Imports
# %%
import numpy as np
import random
import pandas as pd
import matplotlib.pyplot as plt
from scipy.integrate import odeint, solve_ivp
import seaborn as sns
from sklearn.metrics import mean_squared_error, r2_score
from lmfit i... |
aebe9020006d51cdfe64a7ef5dbf3d4db87c93e9d76f4737958766239287533d | Jupyter | 22,906 | 542 | # %% [markdown]
# # Causal Survival Analysis
# The modules under `causallib.estimation` estimate treatment effect on outcomes that are measured at a particular time point (e.g., effect of smoking cessation on weight gain measured in 1982, or a binary outcome indicating occurrence of event within a specified observation... |
375744bc4c04abe711e9b95fd86483d9e8c2a62429ebbfb8f00f38dbac50693c | Jupyter | 23,078 | 685 | # %% [markdown]
# # Task 1 Results Figure
# Kai Sandbrink
#
# 2024-03-09
# %%
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import pickle
from utils import format_axis
import statsmodels.api as sm
from statsmodels.stats.multicomp import pairwise_tukeyhsd
fr... |
f97029056de0faf4260ddb86960e9700eb6e55fa1ddb90f2dc6635a48624db87 | Jupyter | 23,094 | 692 | # %%
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# import warnings
import json
from matplotlib.backends.backend_pdf import PdfPages
# from sklearn.preprocessing import StandardScaler
# from sklearn.model_selection import train_test_split, GridSearchCV, Stratif... |
31d78ce70fa60812d7254ff04e4ba8965b30c852bf37564527a5aff8efe6814d | Jupyter | 23,185 | 868 | # %%
try:
'''
NOTE: On intel machines, sklearn-intelex should be
installed to speed up sklearn quite substantially.
Please see:
https://github.com/intel/scikit-learn-intelex
'''
from sklearnex import patch_sklearn
patch_sklearn(verbose = False)
except:
pass
import... |
ab6908ca6a79342a5bc0bc5d0034aa3e00bb024d3e2e7864e4b20c27616f6cc6 | Jupyter | 23,199 | 662 | # %% [markdown]
# ## Introduction:
# %% [markdown]
# This is the first of a series of notebooks whose goal is to interactively show you some techniques to visualize and analyze behavioral and neural data.
#
# We assume some familiarity with Python, but we try to have a progressive complexity so that you can learn as ... |
5a58235ecb1aaad65252ba1ac83619bb4f27504133b4d2f78b1ffda9e0f949e7 | Jupyter | 23,336 | 702 | # %%
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# import warnings
import json
from matplotlib.backends.backend_pdf import PdfPages
# from sklearn.preprocessing import StandardScaler
# from sklearn.model_selection import train_test_split, GridSearchCV, Stratif... |
9a840455fc6ee25adea5f487bf5a80efa93ee0844bf454daaa16b10f8e8ce3ec | Jupyter | 23,380 | 584 | # %% [markdown]
# density1_estimation_all_region_XXslices_average_reconstcords_voxvol
# - density1: official pipeline step 1
# - estimation: we only have access to a subset of the cells
# - all_region: whole mouse brain (for now: except 3 problematic regions)
# - XX slices: MERFISH slices only 53
# - average: we don't ... |
f275da1ef70d4064a876812c837f62d6aca2e7702937a2860d388a3776966fc0 | Jupyter | 23,383 | 563 | # %%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import explained_variance_score, mean_absolute_error, mean_squared_error, r2_score
# 相关系数
from scipy.stats import pearsonr
from scipy.stats import spearmanr
from scipy import optimize
from numpy import polyfit
import os
imp... |
bb5851bb5551ee18aefada7a7a71dcec4936d289cc2af418cb7ad4edef5f3716 | Jupyter | 23,439 | 651 | # %%
import numpy as np
import pandas as pd
import time
import csv
import random
import matplotlib.pyplot as plt
from tqdm import tqdm
from sklearn import metrics
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
from sklearn.utils.class_weight import compute_class_weight
im... |
8b7078cc8e8011b394ff9c3542878a58894be54dec074ed2bb5ef8ac3b3f0580 | Jupyter | 23,487 | 542 | # %%
from infopath.model_loader import load_model_and_optimizer
from infopath.config import load_training_opt,save_opt
import matplotlib.pyplot as plt
import torch
import seaborn as sns
import numpy as np
from infopath.opto import opto_effect, light_generator, light_area
from tqdm import tqdm
import pandas as pd
impor... |
840ef4f03139e4f39c0410ffd8d06f265c9b0a484e22bf10870ad523bdc25a53 | Jupyter | 23,542 | 470 | # %%
import numpy as np
import matplotlib.pyplot as plt
import os
import pickle
from matplotlib.ticker import PercentFormatter
# %%
colors = plt.cm.viridis(np.linspace(0, 1, 20))
plt.rcParams['font.family'] = 'Arial'
plt.rcParams['font.size'] = 8
plt.rcParams['svg.fonttype'] = 'none'
colors_0=['#0B559F','#2A7AB9','#53... |
ecc0a16fdf603f640ea6cf5040b96e2ed12288ccfee771282067a803b96c51f4 | Jupyter | 23,629 | 573 | # %% [markdown]
# <a href="https://colab.research.google.com/github/CPernet/OpenNeuro_MetaPrivAssessment/blob/main/Correlation_Analyses.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Import Libraries
# %%
# Import Libraries
!gi... |
2df50daaf2bc2ab92ac8d32b8decbafa712a3b76dccb339270f2658dbb26abc4 | Jupyter | 23,781 | 712 | # %%
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import json
from matplotlib.backends.backend_pdf import PdfPages
from sklearn.ensemble import RandomForestClassifier
import cluster_pairs as cp
import scipy.stats as stats
import scikit_posthocs as sp
from st... |
78f4619fba1c4cc6d15c5aa5d95c334d7021c3b8627082e3904ecfa1a31e385a | Jupyter | 23,836 | 677 | # %%
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import precision_score, recall_score
from sklearn.metrics import mean_absolute_error, mean_squared_erro... |
81bbafbeea6b25c6885ef9b0b34f7b1b501cb5ef7d64118bf78a9ee0900a2635 | Jupyter | 24,107 | 889 | # %%
HOME_DIR = '/Users/askhaled/Documents/MegaMouse/'
DESTINATION = 'outputs'
# %%
# ## Libraries
%pip install scipy==1.11.4
#libs
import sklearn
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import MinMaxScaler
from sklearn import l... |
09fc95fdfa780d07d27d335459cc326d40734583ca19c1753d2b67d4993f2a4e | Jupyter | 24,297 | 956 | # %%
pip install numpy scipy torch scikit-learn matplotlib
# %%
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import mean_squared_error
# ===============================
# 1. OTFS SYSTEM SIMULATION
# ============... |
4ba98d04d5277112d16c16a422e0fa96751ee35bb56a816b6fbcaccaf6ac0d35 | Jupyter | 24,457 | 726 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import scipy
from scipy.linalg import eig
#gridspec
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import sys
sys.path.append('..')
from cann import CANN1D
# %% [... |
91d22c2f5f594aee146e53c51d55fbcce03f3c802b14acb245fd4e3d759d1f9a | Jupyter | 24,760 | 724 | # %% [markdown]
# ## Curate epithelium patches from BReAst Carcinoma Subtyping (BRACS) database (https://www.bracs.icar.cnr.it/)
# %%
import os
import pandas as pd
import numpy as np
import openslide
import matplotlib.pyplot as plt
import glob
import cv2
from pathlib import Path
from PIL import Image
import random
im... |
42d7cf49f95c8a9e8262b294a07d73e9d20b62fe555961c07f171c270c214fa3 | Jupyter | 24,919 | 760 | # %%
import numpy as np
import matplotlib.pyplot as plt
import sciplotlib.style as splstyle
import matplotlib.patches as patches
import scipy.stats as sstats
import os
# %% [markdown]
# # Spike Detection
# %%
import scipy.io as sio
c = sio.loadmat('/Users/timothysit/mecp2/python/notebooks/bior1.5waveletC.mat')['c... |
ad57a9672b13ce97c40bb89ab6ac719faf36a3596f699ca0ae79b5c70a6d4046 | Jupyter | 24,933 | 722 | # %%
import os
import json
import pandas as pd
import numpy as np
import glob
from matplotlib.gridspec import GridSpec
import matplotlib.lines as mlines
import seaborn as sns
import matplotlib.pyplot as plt
from utils.setup_paths_and_configs import setup_paths_and_config
from matplotlib.colors import LinearSegmentedC... |
88c455a93011ff68a32d4ed7577414596a1bf01496b3ae55586d9337b69b4584 | Jupyter | 24,950 | 574 | # %%
import pandas as pd
import numpy as np
import torch
from torch_geometric.data import Data
import pickle
import seaborn as sns
from torch_geometric.utils import to_networkx
import os
os.environ['TORCH'] = torch.__version__
print(torch.__version__)
# Helper function for visualization.
%matplotlib inline
import matpl... |
8d8719a306eac7a19eacc46fcd96bd835bcc7cb86928eaffc14e0a096ef93d4c | Jupyter | 24,992 | 653 | # %% [markdown]
# # Training the RPN signature on multi-center data
#
# - This jupyter notebook is available on-line at:
# - https://github.com/spisakt/RPN-signature/blob/master/notebooks/1_multi-center_training.ipynb
#
# - Input data for the notebook and non-standard code (PAINTeR library) is available in the repo... |
6a5a3c45639a205c366f1f26780e0206085ad6381f33fde8c3910c4e271885b4 | Jupyter | 25,031 | 672 | # %% [markdown]
# ## Figure 3CDE
# %%
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import matplotlib as mpl
plt.style.use("article.mplstyle")
import mne
from statannotations.Annotator import Annotator
import itertools
import glob
import os
import sys
from scipy.io i... |
45f01e823b79470fcc8681690728babdc18a495b546afbdf3c3cec55649b88c3 | Jupyter | 25,175 | 654 | # %% [markdown]
# # Supplementary Figure
# Kai Sandbrink
#
#
# 2024-06-01
# %%
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import pickle
from utils import format_axis
analysis_folder = os.path.join('..', 'panels', 'fig_supps')
os.makedirs(analysis_folder... |
77ee551917d4320ec9cbd68a0223040ebcbec9370fee60d7f93d386ecf02a406 | Jupyter | 25,317 | 707 | # %%
from model import run_exp
from model import default_params as params
import utils as utl
from brian2 import Hz
import pickle
from pathlib import Path
config = {
'path_comp' : './2023_03_23_completeness_630_final.csv', # completness data
'path_con' : './2023_03_23_connectivity_630_final.parquet', ... |
7102f953dc3f6cfd052d298fb2416ac9dec9fe0adb4af0d739f52b8db47daab1 | Jupyter | 25,541 | 477 | # %%
from infopath.model_loader import load_model_and_optimizer
from infopath.config import load_training_opt, compare_opt, save_opt
import matplotlib.pyplot as plt
import torch
import numpy as np
from infopath.utils.functions import run_with_perturbation
import os
from infopath.utils.plot_utils import plot_with_size,... |
5fc8efe58c2f658ad6ba4be651774a504b1f33b8d3eedf6714a1f41c0eb786d4 | Jupyter | 25,744 | 573 | # %%
import os
import h5py, tifffile
import numpy as np
import random, cv2
from tqdm import tqdm
os.chdir("../scripts/data_preparation")
label_shape = (100, 3)
# %% [markdown]
# #### Setup
# This cell should contain everything that you might need to change, with the one exception being adding datasets, in which cas... |
f1291b847711d74a04144e6defbee55b1934867ab17a79a6c217101e1c387dd8 | Jupyter | 26,110 | 783 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import scipy
import sys
sys.path.append('..')
from cann import CANN1D
seed = 123
# %% [markdown]
# ### 1, simulate theta sweep at two different adaptation strength
# %%
#set default ramndom seed for reproducibili... |
2d2706ba977f495344c1a23261de71cad3800fe7c25ec0489bd6f403fde78cee | Jupyter | 26,129 | 518 | # %% [markdown]
# ## 16S Analysis
# This code was run in QIIME2 (v.2019.10) and was used to analyze primate fecal sample communities (stocks) from three primate species and germ free mice inoculated with those stocks. We performed both an analysis of all samples together (stocks + mice) and just the experimental sample... |
35a3107eac31b522ca5ec65d944acca391e3aa36a2f791474c1792fa70c9c3be | Jupyter | 26,177 | 605 | # %%
# import relevant packages
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
import scipy.stats as ss
import seaborn as sns
import torch
import torch_geometric
from torch_geometric.loader import DataLoader
# set figure parameters
sc.settings.set_figure_params(dpi=100)
# ... |
c01ac1620de74ee79938637d2578c8e9bc65954e8f1775bb529a98e59feff30c | Jupyter | 26,557 | 505 | # %%
import re, time, warnings, os, sys, copy
from typing import Union, Dict
import gzip, pickle
import numpy as np
import pandas as pd
import gzip, pickle
import scipy, sklearn, mne
import auxiliary as aux
import data, rsa
sys.path.append('../spaces/')
import embeddings as emb
import pubplot as pub
import matplotlib... |
0552e26bc2835af463e441c215d811361883a38ee411672b5d416c4e35e03eee | Jupyter | 26,559 | 502 | # %%
import pandas as pd
import numpy as np
import glob
import os
from sklearn.model_selection import LeaveOneGroupOut
from sklearn.cross_decomposition import PLSRegression
import statsmodels.api as sm
import statsmodels.formula.api as smf
import seaborn as sns
import matplotlib.pyplot as plt
import warnings
from tqdm ... |
636554e52f00be61a169346c23f751eb644f784994b3266a7d761d37762aab05 | Jupyter | 26,590 | 711 | # %% [markdown]
# # 03-replication-analysis-fs6.ipynb
#
# Using `ibs-brain` conda environment
#
# Arvid Lundervold
#
# Last updated: 2024-12-04; 2025-02-10; 2025-02-12 (Figs. 3 & 4 revised, 300 dpi)
#
#
# Replication analysis of the Skrobisz et al. paper (Diagnostics, 2022) based on FreeSurfer v 6.0.1 using<br>
#... |
05181cc812786fe5da10e10f495759832509551e93356425fd3f30f80d93a1fd | Jupyter | 26,611 | 691 | # %%
import pandas as pd
import numpy as np
import scanpy as sc
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
from matplotlib.patches import Patch
from matplotlib.lines import Line2D
# %%
sns.reset_orig()
sc.settings._vector_friendly = True
# p9.theme_set(p9.theme_classic)
plt.rcParams["sv... |
b78c877b309a76df5163e878c0d537d406de81095a0611fd5872cf2ae160deae | Jupyter | 27,063 | 602 | # %%
# exp_name = "rewiring_ex1"
# exp_name = "rewiring_ex2"
# exp_name = "rewiring_ex3"
# exp_name = "rewiring_ex4"
exp_name = "rewiring_ex5"
# model_name = 'Limbacher'
model_name = 'Gidon_dend'
# exp_result_name_folder = 'coactive8'
# exp_result_name_folder = 'Random_input'
# exp_result_name_folder = 'Sequential_... |
39bde7082ed9aef5c8265d4d31a75aeb70d6aac8e93852b01289dd01bbf378e4 | Jupyter | 27,135 | 496 | # %% [markdown]
# # 3. Ground-truth retina (Stage 1b: Retinal mosaic)
#
# This Jupyter notebook demonstrates how to generate a ground-truth retina that uses the output of the reaction-diffusion modelling for the starting mosaic. The output is a retinal parameter array, which we will save to a FITS file to be used late... |
4e6fed100900e44558a8d5c132e6adc722b21027eefd1d28d7fd11a0ecd07592 | Jupyter | 27,182 | 903 | # %%
suppressPackageStartupMessages(library(ggseg))
suppressPackageStartupMessages(library(ggseg3d))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(scales))
suppressPackageStartupMessages(library(ggsegDesterieux))
suppressPackageSta... |
2ad9d93d42130aac9b0b17230461128dd8ddf058e681c6e18418ccdce10ac369 | Jupyter | 27,241 | 645 | # %% [markdown]
# # How to interprete k-global?
#
# A value of k-global can be thought of as its k-anonymity contribution for the entire dataset. It is defined as
#
# `ki_global = (Un-Ur)/Ui `
#
# `Un` is the the number of unique combinations of the variables in a dataset
# `Ur` is the the number of unique combinati... |
f1342c6f915dac47a38cb071d04a28a1239c37847958e1a827da743a256dfa1d | Jupyter | 27,524 | 632 | # %% [markdown]
# ```{eval-rst}
# .. role:: nge-yellow
# ```
# {nge-yellow}`Detailed Training Protocol`
# ===================================
# %% [markdown]
# The training process is typically invoked via the command line interface via the ```skoots-train``` command. This calls into the main function in file ```skoo... |
7958a1c4fda160315f1789157cda4aa8170f2d546db1a8db0417f5941b25d86f | Jupyter | 27,525 | 789 | # %% [markdown]
# # Task 2 Results Figure
# Kai Sandbrink
#
# 2024-03-11
# %%
import os
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import pickle
from utils import format_axis
import statsmodels.api as sm
from statsmodels.stats.multicomp import pairwise_tukeyhsd
fr... |
8224c2f88d39472e982ddfd1b495d01fb49dce61a2e094f140972456559889f2 | Jupyter | 27,599 | 616 | # %%
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
import json
from matplotlib.backends.backend_pdf import PdfPages
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split, GridSearchCV, StratifiedKFo... |
c8887ab46da4a314f2f08d7114cf26717f88edc51c1209f441c8c38697158fb9 | Jupyter | 27,606 | 687 | # %% [markdown]
# Before running the code, please download the required package first like torch, numpy ...
# %%
import torch
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
from torch.nn.parameter import Parameter, UninitializedParameter
from torch.nn ... |
bc489e2410210a4510da99aa63e93ba82103bd80e970e0e8e5d57f926bce7ede | Jupyter | 27,628 | 748 | # %%
import joblib
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from nilearn.connectome import ConnectivityMeasure
from matplotlib import cm
from matplotlib.colors import Normalize
import sys
sys.path.append('../')
from PAINTeR import plot # in-house lib used for the RPN... |
dc900fd81407a6d08b2344d2baf7e8438308b2d46e0be6441a52414d73d4453c | Jupyter | 27,638 | 748 | # %%
import joblib
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from nilearn.connectome import ConnectivityMeasure
from matplotlib import cm
from matplotlib.colors import Normalize
import sys
sys.path.append('../')
from PAINTeR import plot # in-house lib used for the RPN... |
ce6e320ac43b11a77017055433a951acb1c8a22d074baaea59b86eba046f0088 | Jupyter | 27,824 | 807 | # %% [markdown]
# # Prot T5 Finetuning
# # per protein prediction
#
# This notebook allows you to finetune ProtT5 to your own datasets
#
# The protein language model ProtT5 was first published [here](https://ieeexplore.ieee.org/document/9477085) and is available on [github](https://github.com/agemagician/ProtTrans). ... |
8d0f38b61902895e8745228700a8161850a4029f1b53ff22b662a9afb1bf93ff | Jupyter | 27,855 | 939 | # %% [markdown]
# # **Cell 1-Detected folders in datase, (1) Class_Names, (2)Alias Mapping, (3) Exact totals + exact split, (4) Build paper_class, (5)Exact subsample + exact split per class.**
# %%
import os, numpy as np, pandas as pd, re
DATA_ROOT = "/kaggle/input/optimized-cnn-colon-cancer-histopathological/9 Class... |
754ba1c901b1cb53193037dd74ec5e0f249d0f42bc438bf9c8aff2483af2af61 | Jupyter | 27,890 | 890 | # %%
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import mean_squared_error as mse
import numpy as np
import requests
import os
import zipfile
from tqdm import tqdm
import alignn
from alignn.models.alignn import ALIGNN, ALIGNNConfig
from alignn.data import get_torch_dataset
from torch.utils.... |
b951193d30cb5ee45265a319d6de7c915b433f65170ce2caaa1fd15157aab7c3 | Jupyter | 27,948 | 958 | # %%
import pandas as pd
import os
import numpy as np
import json
from utils.training.sampling_functions import *
from sklearn.preprocessing import KBinsDiscretizer
from matplotlib.lines import Line2D
import matplotlib.pyplot as plt
# %%
save = False
root_dir = os.path.dirname(os.getcwd())
data_dir = os.path.join(r... |
cddfe09d128a1361010d584eec2273cde99dee02dca99ec67d677b80c1d4a206 | Jupyter | 27,956 | 639 | # %% [markdown]
# # Comparison of predictive features between the single- and multi-center RPN signature
# - This jupyter notebook is available on-line at:
# - https://github.com/spisakt/RPN-signature/blob/master/notebooks/2_feature_analysis.ipynb
# - Input data for the notebook and non-standard code (PAINTeR library... |
98a23eaf7eb115825f327222845c4c1e803703ed3e95ccbb9e1754ef1e4cfcd2 | Jupyter | 28,053 | 533 | # %%
from src import utils, trnvaltst_sigmoid_oned, TGCNN_layer, whole_model, whole_model_demographics, create_fake_patients, plot_figures
from early_stopping_cv import EarlyStopping
import tensorflow as tf
from sklearn.metrics import f1_score, accuracy_score, confusion_matrix, precision_score, roc_auc_score, recall_sc... |
c46afa94dc128e38452a4bcff01f6777ef5fe07fdc95a2dbdafcab0335bfc655 | Jupyter | 28,104 | 734 | # %% [markdown]
# # SIMULATION
#
# The model uses a modified JansenRit NMM and the standard TVB connectome, both altered in order to simulate EEG signals at different levels of neurodegeneration
# %% [markdown]
# The first thing we need to do, is to import the necessary TVB modules and some additional Python packages... |
1de9b4175bcf151b2b25b4f0ab469b6880b164f90e310f512381398040c88933 | Jupyter | 28,115 | 731 | # %% [markdown]
# Before running the code, please download the required package first like torch, numpy ...
# %%
import torch
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
from torch.nn.parameter import Parameter, UninitializedParameter
from torch.nn ... |
3e770a2c2d085fba6b22fe8008b10c017d6d5145dacd1592d62444f5a7fbd350 | Jupyter | 28,300 | 708 | # %%
!which python
import pandas as pd
print(pd.__version__)
import sys
print(sys.version)
import inspect
print(inspect.getfile(pd))
# %% [markdown]
# **MAKE SURE THE PICKLE FILE USED HERE IS UP TO DATE!**
# (It won't load with Python 3.9 or older.. )
#
# The pickle file is created in density3_test_total_neuron_count... |
54eaf66551b3c702750d720f0082cc81bbeae2ae5561186499d8386001904d51 | Jupyter | 28,516 | 844 | # %%
import os, importlib, sys, time, h5py
# %%
import numpy as np
from scipy import linalg, stats, ndimage, io
from scipy.sparse import diags
# %%
import matplotlib.pyplot as plt
from matplotlib import rc
# rc('font',**{'family':'sans-serif','sans-serif':['Helvetica'], 'size':12})
## for Palatino and other serif fon... |
6486e1c45008579d456a28c5515a9d85a4ed488a46048dd872a52f5f2095e6cb | Jupyter | 28,542 | 567 | # %% [markdown]
# In this notebook we're editing the AIBS csv file on parcellation_to_parcellation_term_membership. This step is not necessarily required but it makes working with this metadata easier.
# %%
import pandas as pd
import numpy as np
# %%
# file = '/gpfs/bbp.cscs.ch/data/project/proj84/csaba/aibs_10x_mou... |
a6dde7f229771f7a6b8c632457a229e0f6aed1949ee0918355e8125a0cbdc85b | Jupyter | 28,608 | 621 | # %%
import math
import pickle
import datajoint as dj
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.ticker as plticker
from mpl_toolkits.axes_grid1 import make_axes_locatable
from scipy import ndimage
import scipy
import seaborn as sns
import torch
fr... |
b71d45bdc1eae86e6466f2b11a2d13d9ec9567de7d12a675917410ddb04800e1 | Jupyter | 28,894 | 677 | # %% [markdown]
# # Comparison of predictive features between the single- and multi-center RPN signature
# - This jupyter notebook is available on-line at:
# - https://github.com/spisakt/RPN-signature/blob/master/notebooks/2_feature_analysis.ipynb
# - Input data for the notebook and non-standard code (PAINTeR library... |
5a9fdd131cd73a5d80d69e540c481175143f8f6c28a9e602886cce783e935214 | Jupyter | 28,933 | 612 | # %%
import numpy as np
import matplotlib.pyplot as plt
import os
import pickle
from matplotlib.ticker import PercentFormatter
# %%
colors = plt.cm.viridis(np.linspace(0, 1, 20))
plt.rcParams['font.family'] = 'Arial'
plt.rcParams['font.size'] = 8
plt.rcParams['svg.fonttype'] = 'none'
colors_0=['#0B559F','#2A7AB9','#53... |
5b09f73d3875ac832df649815b2c94a1a77fb7e20355bed57582babfe3b50726 | Jupyter | 29,077 | 768 | # %% [markdown]
# # Retinal AD
# This notebook contains code for predicting brain pathology and cognitive measures from measures taken from retina. The original data has been modified to remove invalid entries (e.g., dates in measures).
# The code investigates two sets of questions:
# - Can we predict brain pathologies... |
cbe9577db7c09c5b7f1e4cd8cedf025f6bb290c0f562c4ad3f8da3c0912e4b38 | Jupyter | 29,160 | 806 | # %%
!pip freeze
# %%
import pandas as pd
import numpy as np
# %%
import pandas as pd
import numpy as np
extended_p_me_t = pd.read_csv("../probabilistic_mapping_extention/extended_p_me_t.csv", index_col=0)
common_t_types = extended_p_me_t.index
msk_t_types = np.asarray([("IMN" not in x) & ("NN" not in x) for x in c... |
1d4e13aa10fb3a9cba2559299b0eeab6db39205416b5f3e723a37888c49f05f9 | Jupyter | 29,240 | 798 | # %% [markdown]
# # Imports
# %%
# perform imports
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy import stats
from sklearn.linear_model import LinearRegression, Lasso
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import OneHotEncode... |
4baafcc95dcb7864a1b538aa1f1fc090b87f3b0e03da8a831315d39402ec3e9f | Jupyter | 29,258 | 816 | # %%
!pip freeze
# %%
import pandas as pd
import numpy as np
# %%
import pandas as pd
import numpy as np
extended_p_me_t = pd.read_csv("../probabilistic_mapping_extention/extended_p_me_t.csv", index_col=0)
common_t_types = extended_p_me_t.index
msk_t_types = np.asarray([("IMN" not in x) & ("NN" not in x) for x in c... |
0f96a2e0c2dfba2168f9fb8cf69eb8ffaa3c4c2504649f6dc8b2f53fab9a6057 | Jupyter | 29,270 | 644 | # %%
from infopath.model_loader import load_model_and_optimizer
from infopath.config import load_training_opt
import matplotlib.pyplot as plt
import torch
from tqdm import tqdm
import numpy as np
import os
from infopath.utils.plot_utils import plot_with_size, strip_right_top_axis
import ast
import pandas as pd
%reload... |
783d09c594f44ea9d918c863c2740d9ca716ddd767053b959d20e294c929d05c | Jupyter | 29,331 | 849 | # %% [markdown]
# ## Figures 3AB, 6ABCDG, S3, S10B
# (3AB also the same as in fig 6)
# %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
plt.style.use("article.mplstyle")
import pandas as pd
import seaborn as sns
import mne
import glob
import os
import sys
from scipy.stats import pearso... |
db3bac0cd520efab469e8c674a4871731f99a2d595cb213f670cbc44ac773c62 | Jupyter | 29,471 | 863 | # %%
import pickle
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torch.utils.tensorboard import SummaryWriter
from sklearn.m... |
5703019887493624ffe503453f76fef05cea9fab069644827c17246f652690de | Jupyter | 29,490 | 831 | # %%
import os
os.environ['PYTHONHASHSEED'] = '0'
os.environ['TF_DETERMINISTIC_OPS'] = '1'
os.environ['CUDA_VISIBLE_DEVICES'] = ''
import random
import numpy as np
import pandas as pd
import re
import glob
from collections import defaultdict
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.me... |
2eae887f68b98bd344b5c515a718af552603588c79dbb93d794e922262e256e3 | Jupyter | 29,671 | 720 | # %% [markdown]
# # Notebook 1: Afferents
#
# ### General Overview
#
# The afferents, also known as hair fields, transform a time course of joint angles into $N_\text{h}$ hair angles. These hair angles are then converted into currents, which run into mechanosensory neurons. The mechanosensory neurons further convert ... |
2098cbfaafbec498f136d04ddbf370920cd3dc0746bd3a51dde06a23ff60757f | Jupyter | 29,681 | 650 | # %%
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
import nbformat
import os
from scipy.interpolate import interp1d
# Fix random seed for reproducibility
#np.random.seed(42)
#torch.manual_seed(42)
file_path ="... |
77c84222b78ed994c17eb1ffb185e4285326846b4b18ccc98492577d69dcd853 | Jupyter | 29,681 | 650 | # %%
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
import nbformat
import os
from scipy.interpolate import interp1d
# Fix random seed for reproducibility
#np.random.seed(42)
#torch.manual_seed(42)
file_path ="... |
97f1e262e207485fc8d919cc9964f1ea74546aed65100f86866e487e2bdb6132 | Jupyter | 29,699 | 803 | # %%
import joblib
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from nilearn.connectome import ConnectivityMeasure
from matplotlib import cm
from matplotlib.colors import Normalize
import sys
sys.path.append('../')
from PAINTeR import plot # in-house lib used for the RPN... |
477af5f7fa366b85daab533c09425bfd8e5c850dd00986061d95e703b57d85d8 | Jupyter | 29,786 | 1,063 | # %% [markdown]
# # Figure 2
# %%
#Import relevant packages
import numpy as np
import pandas as pd
from matplotlib import rcParams
import os
import scanpy as sc
import matplotlib as mpl
import matplotlib.pyplot as plt
#For nice color schemes
import cmocean
#For barplots
import seaborn as sns
from scipy.stats impor... |
cb137b3386f040bfccbf6a28a716ccc03b13074af46373f1386f11e76e6e0411 | Jupyter | 30,032 | 861 | # %% [markdown]
# # Prot T5 Finetuning
# # per residue classification
#
# This notebook allows you to finetune ProtT5 to your own datasets
#
# The protein language model ProtT5 was first published [here](https://ieeexplore.ieee.org/document/9477085) and is available on [github](https://github.com/agemagician/ProtTran... |
33c76130a7ac2340db1a86aeaf3fdc40a386e33d3e04c5715a321bc1f882ed8e | Jupyter | 30,053 | 693 | # %%
import torch
import numpy as np
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, Subset
# %%
def rand_sparse_matrix(rows, cols, connection_rate):
assert 0 < connection_rate <= 1, "The connection rate must be between (0,1]"
# Calculate the number o... |
100161d5d09c242f902fd22ede7544fb6e62794388ca6c1c2fa74a8633cac631 | Jupyter | 30,120 | 969 | # %%
%matplotlib notebook
import sys
import os
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import cartopy.crs as ccrs
import numpy as np
import obspy as obs
from obspy.signal.invsim import corn_freq_2_paz
import h5py
import pandas as pd
from scipy.signal import medfilt
from filters impo... |
50d5056c68a072025db9f4daf6a5a0d9900743793f9702cbd59c863e5b27b15e | Jupyter | 30,195 | 670 | # %%
import torch
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, Subset
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
import seaborn as sns
import random
import time
from tqdm import tqdm #
import os
from pathli... |
ab2fe298053e4bc2fa0650df91f74a7937b1165af9df5855ec5f5e13138520f6 | Jupyter | 30,204 | 691 | # %% [markdown]
# # handwriting imagery of Chinese character strokes:'一', '丨', '丿', '㇏', 'ㄥ'
# %%
import math
import copy
import gdown
import random
import scipy.io
import os
import mne
import shutil
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn
import matplotlib.pyplot as... |
389947228105c311f07a2a842298115c5c2108a31560153fafa80fc759dd4174 | Jupyter | 30,289 | 838 | # %%
import os
os.environ['PYTHONHASHSEED'] = '0'
os.environ['TF_DETERMINISTIC_OPS'] = '1'
os.environ['CUDA_VISIBLE_DEVICES'] = ''
import random
import numpy as np
import pandas as pd
import itertools
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.metrics import accuracy_score, f1_score, pr... |
43073a160b5d11974cea2c5a380f6480712f63b2381bd229720a15207cdf4e7c | Jupyter | 30,342 | 735 | # %%
from bread.vis import *
from bread.data import Features, SegmentationFile, Microscopy
from bread.algo.lineage import LineageGuesser, LineageGuesserNN, LineageGuesserNearestCell, accuracy
from bread.data import Lineage
import pandas as pd
import numpy as np
import pathlib
import os
from sklearn.preprocessing impor... |
ec0685adb7d8c80c9363e9532860d48cdfed157fd699d4050b3871456c93b874 | Jupyter | 30,430 | 669 | # %% [markdown]
# # Tutorial for extracting graph represenatations of all images
# %% [markdown]
# ## Step 1: Register images from the same FOV
# %%
from numpy.random import shuffle
from pathlib import Path
from novas3d.registration import ImageRegistration
import pickle
from os import mkdir
from os.path import exist... |
21c57af083e68879c4f1378431bfbd800409024c5c6ea9f6fd0a5ba4e52a4db7 | Jupyter | 30,460 | 1,105 | # %%
#python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE
# %%
import nibabel as nib
from nilearn.input_data import NiftiMasker , MultiNiftiMasker
# %%
import numpy as np
import os
import scipy.io
import nibabel as nib
from nilearn.input_data import NiftiMasker
from nilearn.masking import compute_epi_mask
from s... |
3f930978c44fa2b808635b3d7f580b23bb5d051bbe9d549d6d81ef275d54264f | Jupyter | 30,481 | 716 | # %% [markdown]
# # Global imports
# %%
import pandas as pd
import numpy as np
import scanpy as sc
import scipy.stats as stats
from scipy.stats import pearsonr, kendalltau, spearmanr
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.colors import TwoSlopeNorm
from textwrap import wrap
from joblib ... |
9864648f02fc912d76ff0c88569c4c358bd57bc97275a802566ed84245b2292b | Jupyter | 30,496 | 696 | # %% [markdown]
# # Handwriting imagery of simple vowels: a, o, e, i, u, ü
# %%
import math
import copy
import gdown
import random
import scipy.io
import os
import mne
import shutil
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn
import matplotlib.pyplot as plt
from scipy.st... |
08158082b170f35a7df0a1d00b7054420bfdde5f8cf80340a22b8fb23b1c622b | Jupyter | 30,536 | 611 | # %% [markdown]
# # Hierarchial Baysian Modelling of MEP Peak-to-Peak Amplitudes I/O Curve
# %%
# Install required packages if not already installed:
# List of all required packages
required_packages <- c(
# From bmodelling_functions.R
"cmdstanr",
"posterior",
"dplyr",
"ggplot2",
"tidyr",
"rethinking",
... |
b6d36ec1d2375837fea2e7eaf61e07def6fd343bf1c335eb3def0541a7dbb7af | Jupyter | 30,816 | 869 | # %%
#python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE
# %%
import nibabel as nib
from nilearn.input_data import NiftiMasker , MultiNiftiMasker
# %%
import nilearn as nil
# %%
import numpy as np
import os
import os.path
import scipy.io
import nibabel as nib
from nilearn.input_data import NiftiMasker
from nil... |
42273a66a9356882e019a37143fbee2a02d12eeb16f4318ab3562e3792497cdb | Jupyter | 31,082 | 824 | # %%
import os
import numpy as np
import matplotlib.pyplot as plt
import tifffile as tiff
from tqdm import tqdm
from multiprocessing import Pool
from skimage.morphology import skeletonize
import skimage as ski
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %%
from network_flow_tracker import particle
from ne... |
6f26dee9456db92bf0b0e2b7a77b6ded6a0223ebdf699645f31fe5e7a7e017df | Jupyter | 31,128 | 1,084 | # %% [markdown]
# # Import libraries
# %%
"""
Copied from opt-aud_final-project.ipynb in neu480
"""
# %%
import numpy as np
import os
import scipy.io
import nibabel as nib
from nilearn.input_data import NiftiMasker
from nilearn.masking import compute_epi_mask
from sklearn import preprocessing
from sklearn.preprocess... |
e273e2b82259d1c081e4b54e6056c083c8d0ed32d14f85e01cc5cc9bcc9c8a96 | Jupyter | 31,140 | 750 | # %% [markdown]
# ## 导入
# %%
import pandas as pd
# 设置pandas显示所有列
pd.set_option('display.max_columns', None)
# 设置pandas显示所有行
pd.set_option('display.max_rows', None)
import numpy as np
random_state = 2023
csv4 = r'H:\data\data.csv'
data = pd.read_csv(csv4)
data =data.drop(columns = ["na","k","cl","ca","p"])
# 指定变量类型
c... |
d0af5de6031f021f381e6baaf9772428cfc7011db12b862968b2953b3852457c | Jupyter | 31,579 | 839 | # %% [markdown]
# # NSD Data Preparation
#
# Extract shared-image betas for all 4 regions (V1, V2, V4, IT) across all 8 subjects,
# compute per-voxel noise ceilings, and construct a NeuroidAssembly following the
# Hebart2023 pattern.
#
# **Inputs:** Raw NSD data on `/Volumes/Hagibis/nsd`
#
# **Outputs:** Per-region ... |
068a8a6dfaf746e0103e895fbb34d9ca0f4e4426e23e10d57e1c7d9bef7cfc8b | Jupyter | 31,635 | 982 | # %%
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import precision_score, recall_score
from sklearn.metrics import mean_absolute_error, mean_squared_erro... |
4e52cece800c1b72133aba53e21f5eafedff6b55f1582bce8b3928eb02fbc5aa | Jupyter | 31,700 | 926 | # %%
import os
import json
import pandas as pd
import numpy as np
from matplotlib.lines import Line2D
import seaborn as sns
import matplotlib.pyplot as plt
from utils.setup_paths_and_configs import setup_paths_and_config
import math
# %%
dataset = 'OASIS'
sampling = 'representative'
config_path = f'configs/config_{d... |
5799b27c8d4a7899f01e5c61f0ab60ebb008f1c8cf0fb7b83fe1ed9b99c79232 | Jupyter | 31,976 | 746 | # %%
!which python
import pandas as pd
print(pd.__version__)
import sys
print(sys.version)
import inspect
print(inspect.getfile(pd))
# %% [markdown]
# **MAKE SURE THE PICKLE FILE USED HERE IS UP TO DATE!**
# (It won't load with Python 3.9 or older.. )
#
# The pickle file is created in density3_test_total_neuron_count... |
99a3dc2ede936838bd2f728c1573127db14e1e6222b3dd9c9486ee29d24ed31e | Jupyter | 31,984 | 916 | # %%
# experiment 5 MultiClass Classification
import os
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv1D, MaxPooling1D, Flatten, Dense, Dropout
from tensorflow.keras.preprocessing.sequence import pad_sequences
from sklearn.mo... |
23bcf2c832fdd55bc14f1faf4b881516ef0cc5aad2a766e00d180813daf2c895 | Jupyter | 32,002 | 811 | # %%
dryadDir = 'C:/code/miniscope-analysis-mek/InterneuronInhibNAc/InterneuronInhibNAc/dryad/preprocessedData'
figDataSaveDir = r"C:\code\miniscope-analysis-mek\InterneuronInhibNAc\InterneuronInhibNAc\figs\paper_figs\fig_data"
# %%
import pandas as pd
df = pd.read_excel(dryadDir + "/final_IEM_data.xlsx")
import os
i... |
293536a20d5cd6243f2d599eee025e99ac6216aa3a218afd61b3c9c85de6df2c | Jupyter | 32,046 | 1,198 | # %%
#python resample.py $IMAGE_TO_RESAMPLE $REFERENCE_IMAGE
# %%
import nibabel as nib
from nilearn.input_data import NiftiMasker , MultiNiftiMasker
# %%
import numpy as np
import os
import scipy.io
import nibabel as nib
from nilearn.input_data import NiftiMasker
from nilearn.masking import compute_epi_mask
from s... |
f85658964ff21e28ca5377c95bb4592d9c550cda835c2ff65761b576615c8c8c | Jupyter | 32,137 | 812 | # %%
import os, importlib, sys, time, glob
# %%
import numpy as np
from scipy import linalg, stats, ndimage, io
from scipy.sparse import diags
# %%
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica'], 'size':13})
## for Palatino and other serif fonts... |
d3204e978fae72b8234d887fca5083cb9bf077a17f5e4a94bd1743abad3df7ea | Jupyter | 32,140 | 1,045 | # %%
%load_ext autoreload
%autoreload 2
# %%
%config InlineBackend.figure_format = 'retina'
from setup import *
# %%
# %% [markdown]
# # Computations
# %% [markdown]
# ## A priori vs Steady state
# %%
Diffs = []
for temp in TEMPS:
X = load_sequences(bDATAPATH, temp)
bouts_mc = MC.threshold_classifier(X, -... |
3f50563088f95a11b35ebbec25a0005a8a3bc7ffd751771a1810a877993af888 | Jupyter | 32,197 | 784 | # %%
# import relevant packages
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
import scipy.stats as ss
import seaborn as sns
import torch
import torch_geometric
from torch_geometric.loader import DataLoader
# set figure parameters
sc.settings.set_figure_params(dpi=100)
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.