sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
061d112174a6cd5526192f4c8b93ff8f882a1554e97fec7b524da8c053a6f219 | Jupyter | 11,970 | 300 | # %% [markdown]
# # Machine learning and deep learning methods applied to predicting customer status
#
# Purpose: Predict active and not active clients based on the proposed data structure and naive data structure. Here, we implemented Support Vector Machines (SVM), Random Forest (RF), K-nearest Neighbours (KNN) and L... |
51237da259a6c2f9db4936dcadb1492145a70aaa64afe13d233dec7420693dba | Jupyter | 11,991 | 319 | # %% [markdown]
# ## Import all necessary packages to notebook
# %%
import lightgbm as lgb
import os
from sklearn.metrics import accuracy_score
import json
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder, StandardScaler, OneHotEncoder
import optuna
import random
from IPython.disp... |
d208c38ecff220378e024c566a7066e4bc6a86653c5406d50d194a2e72f64558 | Jupyter | 12,001 | 312 | # %%
#@markdown Check type of GPU and VRAM available.
!nvidia-smi --query-gpu=name,memory.total,memory.free --format=csv,noheader
# %% [markdown]
# https://github.com/ShivamShrirao/diffusers/tree/main/examples/dreambooth
# %% [markdown]
# ## Install Requirements
# %%
!wget -q https://github.com/ShivamShrirao/diffuse... |
922d4c6bd5c9355138f85d342c9c27e72af2f1974ee68a1fb803beacfb70ac52 | Jupyter | 12,003 | 307 | # %%
import csv
import pandas as pd
import numpy as np
import os as os
import sys as sys
from collections import defaultdict
import time
from IPython.display import display
import traceback
# %%
from datetime import datetime
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Current Time1 =", curr... |
4b5185aebe299aa6c0cb54e98c18b32207a456997910bfeec292b8058ad69ecb | Jupyter | 12,041 | 324 | # %%
# T6
rsync -avzhe ssh \
conchae@garnatxa.srv.cpd:/home/conchae/PhageDepo_pdb/script_files/esm2_t6_8M_UR50D-finetuned-depolymerase.labels_4 \
/media/concha-eloko/Linux/depolymerase_building
rsync -avzhe ssh \
conchae@garnatxa.srv.cpd:/home/conchae/PhageDepo_pdb/DepoDetection.T6.4Labels.1908.model \
/media/concha-e... |
567dcaceefc8f311f2db7782d386f40dc23430015d1f14be1a07c503def62df8 | Jupyter | 12,047 | 253 | # %%
#import packages
from skimage.io import imread
from skimage.transform import rescale
from shapely.geometry import MultiPolygon, Polygon
from collections import defaultdict
import geopandas
import pandas as pd
import cv2
import numpy as np
import json
import os
import warnings
warnings.filterwarnings('ignore')
# %... |
7a587a569a469365e1a0b1a4df964d034c417d12c68e42b2040dcce90ef8029a | Jupyter | 12,076 | 276 | # %%
import scanpy as sc
from anndata import read_h5ad
import pandas as pd
import numpy as np
import scipy as sp
from statsmodels.stats.multitest import multipletests
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import os
from os.path import join
import gseapy as gp
import statsmodels.api as ... |
55860c929bb9e5299985061f2127e4dd6a2995e6f91f851c97e90489c6d42690 | Jupyter | 12,093 | 325 | # %% [markdown]
# # sinabs Tutorial 使用入门
# ## Take LeNet as an example to train and test a spiking neural network (SNN)
# ## 以LeNet为例训练使用脉冲神经网络(SNN)
# %% [markdown]
# We demonstrate the general steps to construct a useful SNN model in *sinabs* and take LeNet-5 on MNIST for an example.
# 我们以LeNet-5在MNIST的工作为例,介绍创建并使... |
513d7c0a714e9aac57a7b6df43461c350a6691a95600d637a98433452ec840d2 | Jupyter | 12,116 | 410 | # %%
import omicverse as ov
from omicverse.utils import mde
import scanpy as sc
import scvelo as scv
ov.utils.ov_plot_set()
# %%
adata_hpc=sc.read('data/liver_hpc_anno.h5ad',compression='gzip')
# %%
adata_hpc.X.max()
# %%
import numpy as np
import pandas as pd
bulk=pd.read_csv('data/GSE58827_FPKM.txt.gz',index_col=0... |
91b3c24e3894fb12b61d50e05bf2af532921329cb468d7e6c92bf3426c8983cc | Jupyter | 12,121 | 390 | # %%
%load_ext autoreload
%autoreload 2
# %%
import os
import os.path
import skimage
import skimage.segmentation
import sklearn.preprocessing
import sklearn.model_selection
import math
import shutil
import pathlib
import glob
import shutil
import uuid
import random
import platform
import torch
import torchvision
impor... |
343e1bd9f4620cd9dc052cea96088841c3d99f5228c1755bd00edce41f9b8b8a | Jupyter | 12,128 | 302 | # %% [markdown]
# # Benchmarking against PhageDPO and DePP
#
# 1. First download PhageDPO from the [Galaxy framework](https://toolshed.g2.bx.psu.edu/repository?repository_id=77543962c4205a70) and get all the necessary files. This notebook can be put right in the same folder.
# 2. Download [the CLI code](https://github... |
82363037adc216a19d1ae69c45a6ec4c34408fb1ec7167115a2c74ac31f6943c | Jupyter | 12,128 | 321 | # %% [markdown]
# # Import all necessary packages to notebook
# %%
from xgboost import XGBClassifier
import os
from sklearn.metrics import accuracy_score
import json
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder, StandardScaler, OneHotEncoder
import optuna
import random
from IP... |
723979bea9e20bcf6b0b29526e24207cde0b2adb546ff2d7b2e8c1cc10665bab | Jupyter | 12,131 | 374 | # %% [markdown]
# # Figure 4 (ISN regime)
# #### This code runs the simulations and reproduces Fig 4
# %%
from KeyFunctions.TheoryFunctions import *
from KeyFunctions.SimulationFunctions import *
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.pyplot as plt
import matplotlib as mp
# %% [mar... |
694fc1ec2aedb1693e70c4bcc7d46e88b72134cf4662b1d19ec5659ca6676d49 | Jupyter | 12,169 | 312 | # %%
import csv
import pandas as pd
import numpy as np
import os as os
import sys as sys
from collections import defaultdict
import time
from IPython.display import display
import traceback
# %%
from datetime import datetime
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Current Time1 =", curr... |
a7a6a0af50c106dafb4eb1159cefd42055b940258ac093552aef39926ba0c212 | Jupyter | 12,179 | 369 | # %% [markdown]
# The code was adjusted from Marc Vidal De Palol
# %% [markdown]
# __Data Saved:__
# %% [markdown]
# - __recordings_village_old.csv__ --> we save the ids + length of all recordings in one csv (here subject 8 is saved in two separate files)
# %% [markdown]
# __Dependencies__
# %%
import datetime # d... |
e7c5cf9848322842eb73546131bcad738514da3681a3964bdc1e23cc08b97a26 | Jupyter | 12,223 | 280 | # %%
import pandas as pd
import numpy as np
import os
import glob
import matplotlib.pyplot as plt
import matplotlib.cm as cm
# %% [markdown]
# ### Create dictionary with QC measures for each dataset, analysis and CR strategy
# %%
FC_list=['DR0','seed_FC1','DR1','seed_FC0']
Avg_thresh={'DR0':0.75,'seed_FC1':0.65,'DR1... |
de40cfb562595e4569ba6e69bcd0d3cb7b79b73a91d84cc3545470073eaa956a | Jupyter | 12,282 | 334 | # %% [markdown]
# # Review model results - Step 2 - Review one sample
# %% [markdown]
# # Setup
#
# <div class="alert alert-block alert-warning">
# This notebook assumes you have already run notebook <kbd>../terra_featured_workspace/ml4h_setup.ipynb</kbd>.
# </div>
# %% [markdown]
# <div class="alert alert-block... |
2933bc545ea851391a274845b28cc296775f46609eb430a47eeb6f81d322992e | Jupyter | 12,321 | 344 | # %%
using Distributed
addprocs(8);
# %%
@everywhere using PulseInputDDM, MAT
using Flatten
# %%
x_joint = Vector(undef, 3);
x_choice = Vector(undef, 3);
# %%
ratnames = ["B068","T034","T036","T063","T030", "T035","T011","B053", "T080","T103","E021"];
dt, n, cross = 1e-2, 53, false
data_path = joinpath(abspath(joinp... |
7fc6db878fb243b40e05ad41af37ee7bce59992de6449fc2ec6e572f852bc68f | Jupyter | 12,341 | 337 | # %%
from multisensory import *
import numba
from joblib import Parallel, delayed
from scipy.interpolate import RectBivariateSpline
from scipy.optimize import bisect
from warnings import simplefilter
from sklearn.exceptions import ConvergenceWarning
simplefilter("ignore", category=ConvergenceWarning)
plt.style.use(".... |
b1f84a84d45b1404e30d1b55197941fb9f9bf39d57d60431ae14d8204b0f6878 | Jupyter | 12,358 | 359 | # %% [markdown]
# # Finetuning a Pytorch Image Classifier with Ray Train
#
# <a id="try-anyscale-quickstart-pytorch_resnet_finetune" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=pytorch_resnet_finetune">
# <img src="../../../_static/img/run-on-anys... |
bf7b0bf8823c01dbb480ee4e190560b97f71d178c57d7684e2a32ecba10aa831 | Jupyter | 12,366 | 277 | # %% [markdown]
# Figure 7 data analysis
# ============
# %%
# Only run this code cell if you are not running this notebook from the binder
pkg install -forge io statistics tablicious
pkg install "https://github.com/gnu-octave/statistics-resampling/archive/refs/heads/master.zip"
pkg load io statistics tablicious stati... |
040134e311a975bd759dfb65ab3876a4c2dca831ff3ff5978021e06c9bc8afff | Jupyter | 12,445 | 339 | # %% [markdown]
# # BioLGCA - A Mesosocopic Modelling Framework for Collective Phenomena
# %% [markdown]
# ## Introduction
# This Juypter notebook serves as an introduction to the BioLGCA python package. It consists of lattice-gas cellular automaton models for biological systems in 1D and 2D, which can be adapted, sim... |
27ac261c67157fd458528b43200501bbde295638e73bde770ca1a95ca52ce938 | Jupyter | 12,478 | 289 | # %%
# %matplotlib widget
# %%
import flammkuchen as fl
from matplotlib import pyplot as plt
import numpy as np
from scipy import io
import os
import seaborn as sns
import matplotlib.gridspec as gridspec
from matplotlib.ticker import FormatStrFormatter
from pathlib import Path
import pandas as pd
from luminance_analys... |
5f2b1dc45205b8812f465cbcb2fa64fd7c248ef96b216aa9c74c19dbfeb955d8 | Jupyter | 12,510 | 339 | # %% [markdown]
# # Baroclinic instability
#
# This notebook uses dinosaur to run the baroclinic test case from [1]. By default we use T42 grid with 24 layers. For more accurate agreement consider using higher resolution (e.g. T85 and 32 model levels).
# We recommend using a GPU runtime for this notebook.
#
# [1]:
# ... |
9587605c46b0d1ee6844267f92cf778ec349597a1d2a09ab4048c6b7c38a6896 | Jupyter | 12,525 | 366 | # %% [markdown]
# # Moving edge responses
#
# This notebook introduces moving edge responses and the direction selectivity index (DSI). The DSI measures motion selectivity of cells to visual input.
# %% [markdown]
# **Select GPU runtime**
#
# To run the notebook on a GPU select Menu -> Runtime -> Change runtime type... |
854a7267d713a0ddd6ab257b97c50cd16a369cf2b9cdca2e32c033cb58a4582f | Jupyter | 12,556 | 494 | # %%
import networkx as nx
G_all=nx.Graph()
for i in c:
G_all.add_edge(i[0],i[1])
# %%
scipy_kde=st.gaussian_kde(data)
dens = scipy_kde(data)
dens
# %%
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
plt.figure(figsize = (10, 8))
X = np.array(data['F2_3']) # 转化为1D array
scipy_kde = st.g... |
68eac4d69bf2b696c694ba8670cac60fe608a3df51539a121c8d50d04f09275a | Jupyter | 12,579 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
66591f558823d2a86c8cc47d2ef8d3ecd89ece2ca6840aa26b8b49ecdf3ca34b | Jupyter | 12,590 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
e77ebdc1e9bb9a9443329643801d9f97b06ac8668f68f5bf320adf25993ab9c9 | Jupyter | 12,606 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
1430d94815475a93d81f22cf9f93404c8f8857e845ae36df3b07d32a072252ae | Jupyter | 12,619 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
cf12145a9194678aed16526240d7035e54f4ed190c234d70afc77c360afa540a | Jupyter | 12,619 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
3dcf5d7f78b696eae7a3d3220f71589b9cb6fd74cb7fe226341cc9951386a0ff | Jupyter | 12,634 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
afc28b5d8cedc5f84526352842ea40c8fb0aae3bf7dc8f71ba0d10c7602c41bf | Jupyter | 12,642 | 403 | # %% [markdown]
# # Whole cell data analysis
# %%
# Imports
## General
from tqdm import tqdm
import sys
sys.path.append("..")
from RNN_helpers import *
from IPython.display import display, Markdown
import datetime as dt
import pprint as pp
## Math
import numpy as np
import scipy as sp
import scipy.stats as sps
##... |
2114bf5e5c242ad94046e6258c90572a3ec5b55cdb13302b8369ea7f911bfe31 | Jupyter | 12,645 | 312 | # %% [markdown]
# # Load necessary libraries and functions
# %%
from turtle import color
from ccg_library import *
import matplotlib.pyplot as plt
from matplotlib import colors
from matplotlib.colors import LinearSegmentedColormap
import networkx as nx
def generate_random_adjacency_matrix(num_neurons, inhibitory_perc... |
565e05fe0ce40bc8530cd54d86768783bc97e51dc70860267c7fe89075002094 | Jupyter | 12,645 | 237 | # %%
import anndata
import scvelo as scv
import pandas as pd
import numpy as np
import matplotlib as plt
import scanpy as sc
import seaborn as sns
from matplotlib.pyplot import rc_context
%load_ext rpy2.ipython
%matplotlib inline
# %%
scv.set_figure_params()
# %% [markdown]
# Import the dataframe with miracidia sampl... |
f8204bb5619e78724984deaa0eee8b00f7f66e1cbfd3a629ccd6a6ce480be98c | Jupyter | 12,735 | 330 | # %% [markdown]
# # Fine-tune a Hugging Face Transformers Model
# %% [markdown]
# This notebook is based on an official Hugging Face example, [How to fine-tune a model on text classification](https://github.com/huggingface/notebooks/blob/6ca682955173cc9d36ffa431ddda505a048cbe80/examples/text_classification.ipynb). Thi... |
d4bd09857567f93f044ca6681cab8099fba812e4314fc3be911ae5c1c383e8a7 | Jupyter | 12,745 | 295 | # %% [markdown]
# # LeNet5 Analog Training with Tiki Taka Optimizer Example
# Training the LeNet5 neural network with Tiki Taka analog optimizer on MNIST dataset, simulated on the the analog resistive random-access memory with soft bounds (ReRam) device.
#
# <a href="https://colab.research.google.com/github/IBM/aihwk... |
37e55b66e6f32471e9a659952ac38140b1f1a9f6d6b4441f74deefe20ea96bc0 | Jupyter | 12,784 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
92d4f490219b4a6706f58e778bb8589d5c7e60b9eb0119d7365a66aa788d8b16 | Jupyter | 12,793 | 285 | # %% [markdown]
# <a href="https://colab.research.google.com/github/cabooster/DeepCAD-RT/blob/main/DeepCAD_RT_pytorch/notebooks/DeepCAD_RT_demo_colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # **A cloud-based demo for DeepCA... |
b14419928d4c84f2958adaf2db6c0c6eb842766bee2aea60378d77e8f8fad283 | Jupyter | 12,799 | 297 | # %% [markdown]
# # LeNet5 Analog Training with Tiki Taka Optimizer Example
# Training the LeNet5 neural network with Tiki Taka analog optimizer on MNIST dataset, simulated on the the analog resistive random-access memory with soft bounds (ReRam) device.
#
# <a href="https://colab.research.google.com/github/IBM/aihwk... |
d5e48a6d0f420297566c05d4082a3eb9f87506f09c08649cca9151ee0c22c4a7 | Jupyter | 12,847 | 376 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
6b3d4903e3edfd897175862a1d2bdfe4ae535c41ebf3fad0c026c2a03a8c2fe7 | Jupyter | 12,860 | 308 | # %%
import math
import time
from collections import defaultdict, Counter
import numpy as np
import pandas as pd
from scipy import stats
from sklearn.linear_model import LogisticRegression, LinearRegression, ElasticNet, Ridge
from sklearn.metrics import roc_curve, auc, precision_recall_curve, average_precision_score
f... |
4ee5f6c4eeecc02d19494bd3e5edc2e779ad2ac0ec966f9263252d29c5c8091d | Jupyter | 12,864 | 449 | # %% [markdown]
# # Fine tune with Efficientnet
# %%
!pip install keras-cv==0.4.2
# %%
import os, pathlib
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from datetime import datetime
import collections
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pydantic import BaseModel as ConfigBaseModel
... |
a5ab9e9b4abf651bafef229d234da6817ec5cd233f563d874592178d9f5e41b0 | Jupyter | 12,891 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
2b96238dd41f7c7bb7498042b37cd610fd0c0be63dccec86ee486d64bf5708a6 | Jupyter | 12,906 | 364 | # %% [markdown]
# # Uni-Mol Binding Pose Prediction Colab
#
# This Colab notebook provides an online runnable version of [Uni-Mol](https://github.com/deepmodeling/Uni-Mol/) binding pose prediction (short for "docking" in the following) with custom settings.
# Uni-Mol docking is very fast in dozens of seconds.
#
# Pl... |
8328d5da31be7cb56e87fc74e4880dc193ddf91ba9659929506db994c626406a | Jupyter | 12,932 | 424 | # %% [markdown]
# # Density maps
# %% [markdown]
# ## Data loading
# %%
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
import torch
import os
from PIL import Image
BATCH_SIZE = 32
SEED = 666
# Load dataset
x_train_folder = "./data/sorghum_images/train"
x_test_folder = "./data/s... |
35ad8ad87ed44ee78f2b58355f52321e23bdde946222dce23d9365aaf2ec692d | Jupyter | 12,953 | 450 | # %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.animation import FuncAnimation
from IPython import display
import torch
import pickle
import os
# %%
from lib.dataset_config_parser.trained_model_config_parser import parse_prefit_glm_paths
from optimization... |
b22989eca592aa6d27a71097a000c42c9ffff7658ced54d48f9d2380cec400bd | Jupyter | 12,973 | 400 | # %% [markdown]
# # Table of Contents
#
# 1. [Import & Set Up](#import_everything)
# 2. [Load in data](#load_files)
# 3. [Within Pair Correlation](#within_pair_correlation)
# 3. [Center of Mass](#c_o_m)
# 1. [distance apart](#distance_apart)
# 2. [error by overlap](#error_by_overlap)
# 4. [Face Associate Task]... |
94d0fdfbebc77537f1a596f4ec63423205a93f7c3564f1f0dc606e8279e2ac18 | Jupyter | 13,015 | 374 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
3db947f585a8344fd385b1e28d8e541859c04956294a3f9e7388c2f2e5076268 | Jupyter | 13,036 | 450 | # %% [markdown]
# # Fine Tune Efficientnet with GRU
# %%
!pip install keras-cv==0.4.2
# %%
import os, pathlib
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from datetime import datetime
import collections
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pydantic import BaseModel as ConfigBaseMo... |
7598a0b7ddfac42dcedda7930c4805cf2676b938f546424360f95abd6128d073 | Jupyter | 13,148 | 394 | # %%
!sudo apt install python3.7
!update-alternatives --install /usr/local/bin/python3 python3 /usr/bin/python3.7 2
!update-alternatives --install /usr/local/bin/python3 python3 /usr/bin/python3.1 1
!python --version
# %%
!git clone https://github.com/zhenruiliao/tension.git tension
!pip install -e tension
# %%
!pip ... |
fb6922b3b01ac080b5f32a45dddfaf7ff8e738bb6d728746ac4cdd13f4af3c26 | Jupyter | 13,173 | 71 | # %%
# Get the IPR
import os
import pandas as pd
from Bio import SeqIO
good_indices = [29, 6698, 447, 557, 3083, 3080, 5936, 3456, 6406, 6440, 446, 6286, 448, 1557, 5197, 2897, 5919, 2908, 2914, 4706, 6314, 2912, 2916, 1918, 5641, 1570, 4950, 4652, 6634, 4475, 5917, 5017, 5548, 6745, 1667, 5521, 6425, 222, 324, 940,... |
a7c1f7d595de7eac06d1f5579e7d246481a5094b77529f30d355da84940db991 | Jupyter | 13,297 | 357 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
38e88be3ba2387d3b568d8608ad8fb7c863708249491534b9331b472ee797268 | Jupyter | 13,300 | 326 | # %%
import scanpy as sc
from anndata import read_h5ad
import pandas as pd
import numpy as np
import scipy as sp
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
import seaborn as sns
import os
# scTRS tools
import scdrs.util as util
import scdrs.data_loader as dl
import scdrs.meth... |
011d20b1667d5f795de79a8118a76eeb30baeeb728587473428cd09b3f0077af | Jupyter | 13,326 | 424 | # %%
# Imports
## General
import os
import sys
sys.path.append(".")
from RNN_helpers import *
import pprint as pp
## Numerical
import numpy as np
import pandas as pd
import scipy.stats as sps
from scipy.stats import linregress, wilcoxon
## Plotting
import matplotlib as mpl
import matplotlib.pylab as plt
import seab... |
d0569b510866b74c7ae9feec4b798eaa8286eac4a93ee620c129f18f0446617e | Jupyter | 13,351 | 375 | # %% [markdown]
# # TRF encoding results: 4 models
# %%
# This cell returns figures in svg format
%config InlineBackend.figure_formats = ['png']
import h5py
import numpy as np
import pandas as pd
from itertools import product, combinations
from os.path import join as pjoin
import seaborn as sns
import matplotlib.pyp... |
09266695af986d51178823c4c584c5a3ae21762ac4e3ad7d5f9b5cd016289005 | Jupyter | 13,364 | 459 | # %% [markdown]
# # Fine Tune Efficientnet with LSTM
# %%
!pip install keras-cv==0.4.2
# %%
import os, pathlib
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from datetime import datetime
import collections
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pydantic import BaseModel as ConfigBaseM... |
e059fe50b1d812fdd196a26a62d072754aa3d562a43ad40a9e96e3dce2d5f742 | Jupyter | 13,411 | 477 | # %% [markdown]
# # Reproducing cell type analysis (Fig. 3):
# - Set `DATA_PATH` to your local `scDRS_data_release_092121` folder (see below)
# - We use the pre-computed numerical values in the Supp. tables to plot the figures.
# - Alternatively curate the data using `job.celltype_association/summary_ct.ipynb`
# %%
im... |
ae1f6f33b30cdbed6f181db711e3e343b4ac0c3ecb401ada525e4da52535769c | Jupyter | 13,417 | 311 | # %% [markdown]
# # Machine learning and deep learning methods applied to predicting customer status
#
# Purpose: Predict active and not active clients based on the proposed data structure and naive data structure. Here, we implemented Support Vector Machines (SVM), Random Forest (RF), K-nearest Neighbours (KNN) and L... |
2b03c769dfe33064922ac18156a3c81f3932ecb3a3e0c071fee026c0d43604a1 | Jupyter | 13,448 | 403 | # %% [markdown]
# # Basic usage
# %% [markdown]
# *`skorch`* is designed to maximize interoperability between `sklearn` and `pytorch`. The aim is to keep 99% of the flexibility of `pytorch` while being able to leverage most features of `sklearn`. Below, we show the basic usage of `skorch` and how it can be combined wi... |
b6362c0520b350f01231fc9286cf295d7019c47ac7174db12648aefda283360a | Jupyter | 13,500 | 300 | # %% [markdown]
# # Write the results of the Millard DB
# ***
# %%
import os
from tqdm import tqdm
import pandas as pd
#import pprint
import json
#pp = pprint.PrettyPrinter(width = 150)
# Generate a list of path of filtered MSA
path_proteins = "/home/conchae/ML_depolymerase/get_candidates/millard"
path_out = "/home/... |
05a3550e0d873405ab94fc0bac5459b7dff9812c398b1a27872fab709d08d059 | Jupyter | 13,545 | 365 | # %%
import pandas as pd
import numpy as np
import re
from nltk.stem import WordNetLemmatizer
from sklearn.model_selection import KFold
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Embedding, GRU, Dropo... |
98effbb16ae85d7c439446313d193b3c1cac564ae69f99955b3e5b0a46f1b8bf | Jupyter | 13,575 | 361 | # %%
import sklearn
import sklearn.datasets
import sklearn.ensemble
import numpy as np
import lime
import lime.lime_tabular
np.random.seed(1)
# %% [markdown]
# ## Continuous features
# %% [markdown]
# ### Loading data, training a model
# %% [markdown]
# For this part, we'll use the Iris dataset, and we'll train a ra... |
411fd186ab19302d439c162b3b894ddd310ee172423f1ba24d6959ab42c560d7 | Jupyter | 13,612 | 343 | # %%
import csv
import pandas as pd
import numpy as np
import os as os
import sys as sys
from collections import defaultdict
import time
from IPython.display import display
import copy
import traceback
# %%
from datetime import datetime
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Current Ti... |
683d0114cb3f66583c9ee550bcddc983b79c99d595a8b39bbb9f9ddf13d4a4db | Jupyter | 13,620 | 339 | # %% [markdown]
# ## Analyzing dendritic data with CaImAn
# This notebook shows an example on how to analyze two-photon dendritic data with CaImAn. It follows closely the other notebooks.
# %%
import cv2
import glob
import logging
import matplotlib.pyplot as plt
import numpy as np
import os
try:
cv2.setNumThreads... |
632861861eba91171d38242ffbcad1ed23d41f4db2833d654ce82db912f36f89 | Jupyter | 13,644 | 408 | # %% [markdown]
# # Weather forecasts on ERA5
#
# This notebook shows how to initialize the Dinosaur dynamical core to perform a retrospective weather forecast initialized with ERA5.
#
# It shows:
#
# 1. How to construct a Dinosaur initial state from reanalysis data, including data loading and unit conversion.
# 2. ... |
61214b901d1993cb33fd30f6060972402d8b4a11e34cf7536a0951290c963c33 | Jupyter | 13,648 | 398 | # %%
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras import optimizers, losses, Model
import tensorflow.keras.layers as L
from transformers import AutoTokenizer, TFAutoModel
from tensorflow.keras.callbacks import ModelCheckpoint
# Load datasets
# training_df = pd.read_csv("/kaggle... |
b69d916400b474b0cb534400805ae4050c33970eba36f9890dc43ea5cdf3a4b6 | Jupyter | 13,728 | 282 | # %% [markdown]
# ## Motion Correction demo
#
# This notebook demonstrates the varios routines for motion correction in the CaImAn package. It demonstrates the usage of rigid and piecewise rigid motion correction on a two-photon calcium imaging dataset using the NoRMCorre algorithm [[1]](#normcorre), as well as severa... |
b969f0cd7656330c6c9e5f2bc743ac2343afce2cbdafc4a779822f3d7d375cfd | Jupyter | 13,739 | 430 | # %% [markdown]
# ## 1-exploration
#
# Accompanying the paper:<br>
# A. J. Lundervold, ..., A. Lundervold. _Decoding IBS: A Machine Learning Approach to Psychological Distress and Gut-Brain Interaction_
#
# Arvid Lundervold, v. 2024-07-21 - using conda kernel `ibs` (Python 3.11.9))
#
# Last updated: 2024-07-22
# ... |
f2b9cae60ddf78fbc819c579cace754fdbfe69da1bd1d4c2ec9d54fd3de016d7 | Jupyter | 13,932 | 305 | # %% [markdown]
# # 4th - investigating model feature importance with exclusion loss
# %%
import pickle
import pandas as pd
import paintone_rsn.mlfunctions as myml
import numpy as np
from paintone_rsn.data_loading import samplecalibration, load_subjectiid, exclusion, load_timeseries
from paintone_rsn.data_preproc imp... |
67bcc73986183e72b93c39506cbdb233bb2b71655e063dd29f3dba24f93cc556 | Jupyter | 14,000 | 446 | # %% [markdown]
# # Goal : Save the Safada (or the ambiguous ones)
# ***
# ## 0. CD-HIT step
# ## I. Generate representation / Loading the dataframes
# ## II. Transform the features : PCA
# ## III. Clustering
# ## IV. Scan the results
# ***
# %% [markdown]
# ## 0. CD-hit
# %% [markdown]
# -aL alignment coverage for t... |
7413a5c88181fa6e724cbf4995f710fbb4bdf5143d71e6633f109ca2d471b724 | Jupyter | 14,009 | 392 | # %% [markdown]
# # IBM Analog Hardware Acceleration Kit (AIHWKIT): Post Training Input Range Calibration
#
# ### Authors: [Julian Büchel](https://www.linkedin.com/in/julian-büchel-0673991a3/), [Manuel Le Gallo-Bourdeau](https://research.ibm.com/people/manuel-le-gallo-bourdeau), and [Kaoutar El Maghraoui](https://www.... |
5b3efc9a3b73642c76bd17b87410de610591a295cc71ab0a4c0393c0ca91fb06 | Jupyter | 14,095 | 417 | # %% [markdown]
# # MNIST with torchvision and skorch
#
# This notebooks shows how to define and train a simple Neural-Network with PyTorch and use it via skorch with the help of torchvision.
#
# <table align="left"><td>
# <a target="_blank" href="https://colab.research.google.com/github/skorch-dev/skorch/blob/master... |
63a3f32ba599c0aa2c90cf4d7be8a50e94af90498a48ee14b3c5ec9655233922 | Jupyter | 14,102 | 284 | # %% [markdown]
# ## Motion Correction demo
#
# This notebook demonstrates the various routines for motion correction in the CaImAn package. It demonstrates the usage of rigid and piecewise rigid motion correction on a two-photon calcium imaging dataset using the NoRMCorre algorithm [[1]](#normcorre), as well as sever... |
7ae04cce4d5db4d16f829ef5e5f698dd49c7d4c5581c29ad915bf52473c3fa54 | Jupyter | 14,103 | 440 | # %% [markdown]
# ##### Copyright 2021 Google LLC.
# %%
#@title Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.... |
6536180d1d5b9ee9ece90ed768bd78facfdbe9a5df23b89d34b5b6f1f8191da1 | Jupyter | 14,125 | 313 | # %%
from matplotlib import pyplot as plt
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
import sklearn.model_selection as md
from sklearn.metrics import balanced_accuracy_score, ConfusionMatrixDisplay, recall_score
import numpy as np
import pickle
import pandas as p... |
e89b6f84f1d901832465a018582f3dbd43e355182df236877cbb02429859728c | Jupyter | 14,134 | 464 | # %% [markdown]
# ## 3-unsupervised-classification
#
# Accompanying the paper:<br>
# A. J. Lundervold, ..., A. Lundervold. _Decoding IBS: A Machine Learning Approach to Psychological Distress and Gut-Brain Interaction_
#
# Arvid Lundervold, v. 2024-07-21 - using conda kernel `ibs` (Python 3.11.9))
#
# Last updated:... |
5060c777d78aff7aea8425954d84554ac74d5d27f78e8567ee909fd7e0f85a86 | Jupyter | 14,156 | 406 | # %% [markdown]
# ***
# # Identifying the domain delimitations
# %%
path_project = "/media/concha-eloko/Linux/depolymerase_building"
dir_out = f"{path_project}/seekfold_phagedepo"
import pandas as pd
import os
path_info = f"/media/concha-eloko/Linux/depolymerase_building/depolymerase_fold.csv"
info_df = pd.read_csv(... |
5c8059887fafb0ee173a3352d5e7b46130c87a56a131b2fad35fae24e9fe7674 | Jupyter | 14,176 | 397 | # %% [markdown]
# ## Usage Tutorial
# ## compressed-transcriptomics
#
# This is a tutorial notebook for applying our trained autoencoders to compress Allen Brain Atlas transcriptomic data (drawn from abagen) into any of 2,4,8,16,32,64, or 128 components
#
# The original model training code is also given below, should... |
8b7c2da71176bfc0f8925b50a385aae2406f2c38a1185f6081263aba135f9c3b | Jupyter | 14,177 | 253 | # %%
import pandas as pd
# %%
GS_FILE = '/n/holystore01/LABS/price_lab/Users/mjzhang/scDRS_data/gs_file/magma_10kb_1000.gs'
SUMSTATS_FILE = '/n/holystore01/LABS/price_lab/Lab/ldsc/sumstats_formatted/Description_010120.xlsx'
ME_FILE = '/n/holystore01/LABS/price_lab/Users/mjzhang/scDRS_data/supp_table/trait_polygenicity... |
c4cd2099b6302572fd7ffefa1c2e083553bb4140ce91dee050d3811c771a639c | Jupyter | 14,208 | 387 | # %% [markdown]
# ### 4.2 Saliency Mapping - Guided Grad-CAM
#
# Guided gradient-weighted class activation mapping (guided Grad-CAM) was performed to generate activation maps (also known as saliency maps) highlighting the features that have a positive influence on the prediction of the class of interest. We adapted th... |
177db5f78bd0977e9baf0a700d52b0d1de880de5aa7513395a5e7c30b58aec2b | Jupyter | 14,212 | 374 | # %% [markdown]
# # Request missing ERA5 data files from Copernicus Climate Data Store (CDS)
# ### view queued requests at https://cds.climate.copernicus.eu/cdsapp#!/yourrequests
# ### see https://cds.climate.copernicus.eu/api-how-to for details on using the CDS API
# %%
proj_dir='/path/to/main_project_folder/' # edit... |
51a8880ebceee6c4afd1476f7da8f2cfdd37e825acc13f4e7e8a422e237a9df3 | Jupyter | 14,230 | 462 | # %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from imblearn.over_sampling import RandomOverSampler
from imblearn.under_sampling import RandomUnderSampler
from sklearn.metrics import classification_report
from sklearn.model_selection import KFold
import tensorflow as ... |
974ce7b0bb9e9343735015f38c45de3572727f40b36dbc2bee3a640d9b8a3726 | Jupyter | 14,287 | 351 | # %%
import numpy
import h5py
import os
from scipy.ndimage import gaussian_filter, uniform_filter
from scipy import optimize, stats
from skimage.transform import resize
from skimage import filters, feature
from skimage.metrics import structural_similarity, peak_signal_noise_ratio
from sklearn.metrics import mean_squa... |
acd963c958393e652f203edd0bbf1e86041608715b72941e563d33d05159f237 | Jupyter | 14,311 | 401 | # %%
import numpy as np
import matplotlib.pyplot as plt
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test... |
3ffcc728698c70150201985759877dfa88c0f7397ad8b404a9a1369c75673727 | Jupyter | 14,332 | 327 | # %%
import xarray as xr
# %% [markdown]
# <!-- (data-guide)= -->
# # WeatherBench 2 Data Guide
#
# One core part of WeatherBench 2 are ready-to-use, cloud-based datasets. This page lists and describes all the available datasets.
#
# The datasets are stored in this public Google Cloud bucket: [`gs://weatherbench2/da... |
80e8518e92265d4a6e85b33bbe3c73ff478be8c932015697951c35705321bed9 | Jupyter | 14,335 | 423 | # %%
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras import optimizers, losses, Model
import tensorflow.keras.layers as L
from transformers import AutoTokenizer, TFAutoModel
from tensorflow.keras.callbacks import ModelCheckpoint
# Load datasets
# training_df = pd.read_csv("/kaggle... |
f0ce52328c98b9ecceaa60acb99ca3f96bcaca5ecdef75b6abfd76237ce02208 | Jupyter | 14,412 | 426 | # %%
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras import optimizers, losses, Model
import tensorflow.keras.layers as L
from transformers import AutoTokenizer, TFAutoModel
from tensorflow.keras.callbacks import ModelCheckpoint
# Load datasets
# training_df = pd.read_csv("/kaggle... |
c4c1918b2bada0b0ee98e03eab5097bf2cc333c5708efb019f729f9ccd3704f7 | Jupyter | 14,437 | 489 | # %% [markdown]
# # scAnnot
#
# > Single-cell large-scale automatic hierarchical annotation
# %%
#| default_exp core
# %%
#| hide
from nbdev.showdoc import *
# %%
#| hide
import nbdev; nbdev.nbdev_export()
# %%
#| export
import numpy as np
import scanpy as sc
import scvi
from fastcore.script import *
import warnin... |
5da76b3744193e013e2e0cd42348889712bc49984cb4b58594f92a42da8ddc73 | Jupyter | 14,465 | 437 | # %% [markdown]
# # Goal : Scan the 3D predcitions with the Dpo fold database.
# ## However, we will only scan the proteins that did not make it into the first version of the scan
#
# ### A. Make the DB
# ### B. Run Foldseek
# ### C. Get the hits with good proba
# ### D. Report the folds
# ***
# %% [markdown]
# # A... |
bcba8edee080bd688f0d55918468e86a2f5bd7665fc9750ef0a6c6d1293a1022 | Jupyter | 14,482 | 436 | # %% [markdown]
# # Tutorial: Hardware-aware Training and Hyper-parameter Optimiation for MobileBERT / SQuADv1.1
#
# ### Authors: [Corey Lammie](https://www.linkedin.com/in/coreylammie/)
#
# <a href="https://colab.research.google.com/github/IBM/aihwkit/blob/master/notebooks/iscas-tutorial/mobilebert_squad.ipynb" targ... |
568e83919107ab96e8ef4e54d4f4198f7141748e4cdef19b566326f11e371db6 | Jupyter | 14,499 | 410 | # %% [markdown]
# ## Data and SNR Plots
# This notebook was used to create Figures 1 and 4, which show examples of tetromino data across all scenarios for both classes, and an example across four signal-to-noise ratios respectively
# %%
%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
import ma... |
9c1a7ff83f373d8c95e4b3846a18436f1f1be9cf3211df0c5f42d980c2459ac9 | Jupyter | 14,519 | 392 | # %% [markdown]
# # The Depo Detection tool
# >We finetuned the ESM2 model successfully (92% accuracy)<br>
# >The goal now is to stack a RNN layer for a binary classification into Dpo or Not Dpo categories
# ***
# ## I. Load prebuilt model
# ## II. Stack RNN layer
# ## III. Train Eval
# ## IV. Metrics
# ***
# %% [mar... |
3cc70f17e88dd4effaa7057a8d3a9c82f0e34884ee9993a4be08ededceaaa5c9 | Jupyter | 14,525 | 414 | # %% [markdown]
# # Load Test Results Analysis
#
# This notebook analyzes the results from video processing load tests at different concurrency levels.
# %%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import glob
import re
from pathlib import Path
# Style configuration
plt.style.use('seabo... |
b7f0289644a8450e6bbd10aa1fc0bc3a46b6869be374e82543cbf28b8cac2313 | Jupyter | 14,534 | 580 | # %% [markdown]
# # Forward Simulation of 2D VEP model at Source level
# %%
import os
import sys
import time
import errno
import time
import timeit
import numpy as np
import numba
from numba import jit
import matplotlib.pyplot as plt
from matplotlib import colors, cm
# %%
import warnings
warnings.simplefilter("ign... |
977a2cb843a70284dd1a99b80975060bf88fb65097894a9194c7ff2c2de18bb5 | Jupyter | 14,580 | 437 | # %% [markdown]
# # LERCause: Causal Sentence Identification with LER (Nuclear Safety Reports)
# This code is to use a heurisitc method (keyword matching) on LER data for sentence classification and prediction.
#
# Author:
# 1. Jinmo Kim: School of Information Sciences, University of Illinois Urbana-Champaign ... |
abc939dcb226a219933d8d66181fc6effc79ba43e271e5984b29db722b08a4cc | Jupyter | 14,658 | 434 | # %%
import sys
sys.path.append('..')
sys.path.append('../..')
sys.path.append('../../..')
import selective_recruitment.globals as gl
import Functional_Fusion.atlas_map as am
import Functional_Fusion.dataset as ds
from pathlib import Path
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import... |
8f801b85037483404d7227212c4062e60a91833c79d73be6949b4a55210e1752 | Jupyter | 14,662 | 409 | # %%
%load_ext autoreload
%autoreload 2
# %%
%matplotlib inline
import numpy
import random
import time
import sys
import os
import tifffile
import io
import pickle
import matplotlib
from matplotlib import pyplot
from PIL import Image
from pysted import base, utils, raster, bleach_funcs
to_insert = "../.."
while t... |
9550bc8f907ee44800b8e2e1b386be3662b79d7142843d943ec37d32e684123e | Jupyter | 14,685 | 509 | # %%
%load_ext lab_black
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
from IPython.display import display, Markdown, Latex
import scipy
import matplotlib.transforms as mtrans
# %%
def meta_analysis(effects, se, method="random", weights=None):
# From ... |
bf27bd42deb03c9967dcb7a6e5099e9ef95b659ac5f3c0750277cfae7d3f50a6 | Jupyter | 14,723 | 372 | # %%
from sklearn.model_selection import train_test_split, GroupShuffleSplit
from sklearn.metrics import precision_score, recall_score, f1_score, confusion_matrix, accuracy_score, matthews_corrcoef
from transformers import AutoTokenizer
from datasets import Dataset
from transformers import AutoModelForTokenClassificati... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.